<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>QCNSim: QcnSim/QcnSimCCGrid.cpp File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">QCNSim
   </div>
   <div id="projectbrief">Simulator for Quake-Catcher Network</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_d21be12960473ba5c51e5f9beea3525e.html">QcnSim</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#define-members">Macros</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">QcnSimCCGrid.cpp File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &quot;<a class="el" href="_qcn_sim_c_c_grid_8h_source.html">QcnSimCCGrid.h</a>&quot;</code><br/>
</div>
<p><a href="_qcn_sim_c_c_grid_8cpp_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:a7b6b7d6f58a8b7237a92fd3bc195aa66"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_qcn_sim_c_c_grid_8cpp.html#a7b6b7d6f58a8b7237a92fd3bc195aa66">INPUT_FILENAME</a>&#160;&#160;&#160;&quot;..\\Release\\map C high (4 regions) no failure 1.csv&quot;</td></tr>
<tr class="memdesc:a7b6b7d6f58a8b7237a92fd3bc195aa66"><td class="mdescLeft">&#160;</td><td class="mdescRight">Simulation for CCGrid 2014 paper.  <a href="#a7b6b7d6f58a8b7237a92fd3bc195aa66">More...</a><br/></td></tr>
<tr class="separator:a7b6b7d6f58a8b7237a92fd3bc195aa66"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a07852dca1831c7ab358e25355f6c21a0"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_qcn_sim_c_c_grid_8cpp.html#a07852dca1831c7ab358e25355f6c21a0">OUTPUT_FILENAME</a>&#160;&#160;&#160;std::string(<a class="el" href="_qcn_sim_c_c_grid_8cpp.html#a7b6b7d6f58a8b7237a92fd3bc195aa66">INPUT_FILENAME</a>) + &quot;-output.csv&quot;</td></tr>
<tr class="separator:a07852dca1831c7ab358e25355f6c21a0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4bdc13655ee7bf4cf0e66d16e22dc103"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_qcn_sim_c_c_grid_8cpp.html#a4bdc13655ee7bf4cf0e66d16e22dc103">PDU_SIZE</a>&#160;&#160;&#160;512</td></tr>
<tr class="separator:a4bdc13655ee7bf4cf0e66d16e22dc103"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab0894b9662d0cf6a3b811e45bbe1db40"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_qcn_sim_c_c_grid_8cpp.html#ab0894b9662d0cf6a3b811e45bbe1db40">BANDWIDTH_REGION_A</a>&#160;&#160;&#160;8700000</td></tr>
<tr class="separator:ab0894b9662d0cf6a3b811e45bbe1db40"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7847900052c44e0128d7aed8e33fd57d"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_qcn_sim_c_c_grid_8cpp.html#a7847900052c44e0128d7aed8e33fd57d">PROPAGATION_REGION_A</a>&#160;&#160;&#160;0.03</td></tr>
<tr class="separator:a7847900052c44e0128d7aed8e33fd57d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae6e3963e0e76a616b5c808947dd2c776"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_qcn_sim_c_c_grid_8cpp.html#ae6e3963e0e76a616b5c808947dd2c776">BANDWIDTH_REGION_B</a>&#160;&#160;&#160;3000000</td></tr>
<tr class="separator:ae6e3963e0e76a616b5c808947dd2c776"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a38f9c28c77024724afcc614d2dcdc74e"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_qcn_sim_c_c_grid_8cpp.html#a38f9c28c77024724afcc614d2dcdc74e">PROPAGATION_REGION_B</a>&#160;&#160;&#160;0.05</td></tr>
<tr class="separator:a38f9c28c77024724afcc614d2dcdc74e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6d8b96ff7d0e91f1f6b522ed49e5b6ba"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_qcn_sim_c_c_grid_8cpp.html#a6d8b96ff7d0e91f1f6b522ed49e5b6ba">BANDWIDTH_REGION_C</a>&#160;&#160;&#160;5000000</td></tr>
<tr class="separator:a6d8b96ff7d0e91f1f6b522ed49e5b6ba"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9db42258da8f8ad11ab4453a7dd637b3"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_qcn_sim_c_c_grid_8cpp.html#a9db42258da8f8ad11ab4453a7dd637b3">PROPAGATION_REGION_C</a>&#160;&#160;&#160;0.05</td></tr>
<tr class="separator:a9db42258da8f8ad11ab4453a7dd637b3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af258c278dfb4bc81d35ddb8bdd4ba5f2"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_qcn_sim_c_c_grid_8cpp.html#af258c278dfb4bc81d35ddb8bdd4ba5f2">BANDWIDTH_REGION_D</a>&#160;&#160;&#160;5000000</td></tr>
<tr class="separator:af258c278dfb4bc81d35ddb8bdd4ba5f2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a010f0a83db91d4ff135cf281696ebfc1"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_qcn_sim_c_c_grid_8cpp.html#a010f0a83db91d4ff135cf281696ebfc1">PROPAGATION_REGION_D</a>&#160;&#160;&#160;0.05</td></tr>
<tr class="separator:a010f0a83db91d4ff135cf281696ebfc1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a240f0b8cc47ce12ef3257c8addcc1796"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_qcn_sim_c_c_grid_8cpp.html#a240f0b8cc47ce12ef3257c8addcc1796">BANDWIDTH_REGION_FAKE</a>&#160;&#160;&#160;6000000</td></tr>
<tr class="separator:a240f0b8cc47ce12ef3257c8addcc1796"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a25003fc4313519b1e49e07940e1a2f9c"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_qcn_sim_c_c_grid_8cpp.html#a25003fc4313519b1e49e07940e1a2f9c">PROPAGATION_REGION_FAKE</a>&#160;&#160;&#160;0.07</td></tr>
<tr class="separator:a25003fc4313519b1e49e07940e1a2f9c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0bf380a4597f3e8e702b3f4fcb31a17e"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_qcn_sim_c_c_grid_8cpp.html#a0bf380a4597f3e8e702b3f4fcb31a17e">REGION_A_ID</a>&#160;&#160;&#160;1</td></tr>
<tr class="separator:a0bf380a4597f3e8e702b3f4fcb31a17e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acdb16bb6018a7c85d3160c15e9d4089a"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_qcn_sim_c_c_grid_8cpp.html#acdb16bb6018a7c85d3160c15e9d4089a">REGION_B_ID</a>&#160;&#160;&#160;2</td></tr>
<tr class="separator:acdb16bb6018a7c85d3160c15e9d4089a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aacd5aeeefd3d2cdd0a2735dbf01fe1c3"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_qcn_sim_c_c_grid_8cpp.html#aacd5aeeefd3d2cdd0a2735dbf01fe1c3">REGION_C_ID</a>&#160;&#160;&#160;5</td></tr>
<tr class="separator:aacd5aeeefd3d2cdd0a2735dbf01fe1c3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adee06583f1b8b5964a4793f98f3f4bc7"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_qcn_sim_c_c_grid_8cpp.html#adee06583f1b8b5964a4793f98f3f4bc7">REGION_D_ID</a>&#160;&#160;&#160;4</td></tr>
<tr class="separator:adee06583f1b8b5964a4793f98f3f4bc7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a14bd15123cf3bb9a64bf52c1aa988549"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_qcn_sim_c_c_grid_8cpp.html#a14bd15123cf3bb9a64bf52c1aa988549">REGION_FAKE_ID</a>&#160;&#160;&#160;888</td></tr>
<tr class="separator:a14bd15123cf3bb9a64bf52c1aa988549"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a58c3c5ada720c7d45f1dfeaf181e4e0f"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_qcn_sim_c_c_grid_8cpp.html#a58c3c5ada720c7d45f1dfeaf181e4e0f">REGION_A_SOURCE</a>&#160;&#160;&#160;<a class="el" href="_qcn_sim_c_c_grid_8cpp.html#a0bf380a4597f3e8e702b3f4fcb31a17e">REGION_A_ID</a></td></tr>
<tr class="separator:a58c3c5ada720c7d45f1dfeaf181e4e0f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a453b0cdfacfb82674c0846ffcbd42460"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_qcn_sim_c_c_grid_8cpp.html#a453b0cdfacfb82674c0846ffcbd42460">REGION_B_SOURCE</a>&#160;&#160;&#160;<a class="el" href="_qcn_sim_c_c_grid_8cpp.html#acdb16bb6018a7c85d3160c15e9d4089a">REGION_B_ID</a></td></tr>
<tr class="separator:a453b0cdfacfb82674c0846ffcbd42460"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a94fa0bdb40ee4da20e3d8d227276a1c0"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_qcn_sim_c_c_grid_8cpp.html#a94fa0bdb40ee4da20e3d8d227276a1c0">REGION_C_SOURCE</a>&#160;&#160;&#160;<a class="el" href="_qcn_sim_c_c_grid_8cpp.html#aacd5aeeefd3d2cdd0a2735dbf01fe1c3">REGION_C_ID</a></td></tr>
<tr class="separator:a94fa0bdb40ee4da20e3d8d227276a1c0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ace2cec71fb9a16df31aafa9b250e5648"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_qcn_sim_c_c_grid_8cpp.html#ace2cec71fb9a16df31aafa9b250e5648">REGION_D_SOURCE</a>&#160;&#160;&#160;<a class="el" href="_qcn_sim_c_c_grid_8cpp.html#adee06583f1b8b5964a4793f98f3f4bc7">REGION_D_ID</a></td></tr>
<tr class="separator:ace2cec71fb9a16df31aafa9b250e5648"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac3df39d3fa181f7564443145014c76d2"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_qcn_sim_c_c_grid_8cpp.html#ac3df39d3fa181f7564443145014c76d2">REGION_FAKE_SOURCE</a>&#160;&#160;&#160;<a class="el" href="_qcn_sim_c_c_grid_8cpp.html#a14bd15123cf3bb9a64bf52c1aa988549">REGION_FAKE_ID</a></td></tr>
<tr class="separator:ac3df39d3fa181f7564443145014c76d2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9749cc2e7e187e1f302d0158151b293d"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_qcn_sim_c_c_grid_8cpp.html#a9749cc2e7e187e1f302d0158151b293d">REGION_A_DESTINATION</a>&#160;&#160;&#160;(<a class="el" href="_qcn_sim_c_c_grid_8cpp.html#a0bf380a4597f3e8e702b3f4fcb31a17e">REGION_A_ID</a> * 10)</td></tr>
<tr class="separator:a9749cc2e7e187e1f302d0158151b293d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a34ba3a12764116b2aaa23d3165305295"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_qcn_sim_c_c_grid_8cpp.html#a34ba3a12764116b2aaa23d3165305295">REGION_B_DESTINATION</a>&#160;&#160;&#160;(<a class="el" href="_qcn_sim_c_c_grid_8cpp.html#acdb16bb6018a7c85d3160c15e9d4089a">REGION_B_ID</a> * 10)</td></tr>
<tr class="separator:a34ba3a12764116b2aaa23d3165305295"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac4f0f4199bf2f7c707e8ac44ef80dc95"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_qcn_sim_c_c_grid_8cpp.html#ac4f0f4199bf2f7c707e8ac44ef80dc95">REGION_C_DESTINATION</a>&#160;&#160;&#160;(<a class="el" href="_qcn_sim_c_c_grid_8cpp.html#aacd5aeeefd3d2cdd0a2735dbf01fe1c3">REGION_C_ID</a> * 10)</td></tr>
<tr class="separator:ac4f0f4199bf2f7c707e8ac44ef80dc95"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af03badce48baec1f9a831cfff15eb8bf"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_qcn_sim_c_c_grid_8cpp.html#af03badce48baec1f9a831cfff15eb8bf">REGION_D_DESTINATION</a>&#160;&#160;&#160;(<a class="el" href="_qcn_sim_c_c_grid_8cpp.html#adee06583f1b8b5964a4793f98f3f4bc7">REGION_D_ID</a> * 10)</td></tr>
<tr class="separator:af03badce48baec1f9a831cfff15eb8bf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a07f75b830427f4fa3f743119b555dd41"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_qcn_sim_c_c_grid_8cpp.html#a07f75b830427f4fa3f743119b555dd41">REGION_FAKE_DESTINATION</a>&#160;&#160;&#160;(<a class="el" href="_qcn_sim_c_c_grid_8cpp.html#a14bd15123cf3bb9a64bf52c1aa988549">REGION_FAKE_ID</a> * 10)</td></tr>
<tr class="separator:a07f75b830427f4fa3f743119b555dd41"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0c175fc00c53b14b300e30a773b91b94"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_qcn_sim_c_c_grid_8cpp.html#a0c175fc00c53b14b300e30a773b91b94">MAX_SIMULATION_TIME</a>&#160;&#160;&#160;50.0</td></tr>
<tr class="separator:a0c175fc00c53b14b300e30a773b91b94"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8e4724f509582fd412b65aa79d7ebe1e"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_qcn_sim_c_c_grid_8cpp.html#a8e4724f509582fd412b65aa79d7ebe1e">LINK_DOWN_TIME</a>&#160;&#160;&#160;1.0</td></tr>
<tr class="separator:a8e4724f509582fd412b65aa79d7ebe1e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a121218679b2ffe08b52abaf30eb20ab0"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_qcn_sim_c_c_grid_8cpp.html#a121218679b2ffe08b52abaf30eb20ab0">LINK_FAILURE</a>&#160;&#160;&#160;false</td></tr>
<tr class="separator:a121218679b2ffe08b52abaf30eb20ab0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a44d8a25b9f10356063cd072a556efa22"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_qcn_sim_c_c_grid_8cpp.html#a44d8a25b9f10356063cd072a556efa22">REROUTE_TRAFFIC_TIME</a>&#160;&#160;&#160;1.0</td></tr>
<tr class="separator:a44d8a25b9f10356063cd072a556efa22"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a21723b939da0ed1a32b68488677cef98"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_qcn_sim_c_c_grid_8cpp.html#a21723b939da0ed1a32b68488677cef98">REROUTE_TRAFFIC</a>&#160;&#160;&#160;false</td></tr>
<tr class="separator:a21723b939da0ed1a32b68488677cef98"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a31c31bc14c0a859acd22b782f55e38a2"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_qcn_sim_c_c_grid_8cpp.html#a31c31bc14c0a859acd22b782f55e38a2">PRINT_TRACE</a>&#160;&#160;&#160;false</td></tr>
<tr class="separator:a31c31bc14c0a859acd22b782f55e38a2"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a146501a7eea204bdae387e00e88031fb"><td class="memItemLeft" align="right" valign="top">std::shared_ptr&lt; <a class="el" href="class_link.html">Link</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_qcn_sim_c_c_grid_8cpp.html#a146501a7eea204bdae387e00e88031fb">findLinkByNodeB</a> (std::map&lt; unsigned int, std::shared_ptr&lt; <a class="el" href="class_link.html">Link</a> &gt;&gt; linkMap, std::shared_ptr&lt; <a class="el" href="class_node.html">Node</a> &gt; nodeB)</td></tr>
<tr class="memdesc:a146501a7eea204bdae387e00e88031fb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Finds and returns a link pointer form a map of links, given the nodeB.  <a href="#a146501a7eea204bdae387e00e88031fb">More...</a><br/></td></tr>
<tr class="separator:a146501a7eea204bdae387e00e88031fb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0ddf1224851353fc92bfbff6f499fa97"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_qcn_sim_c_c_grid_8cpp.html#a0ddf1224851353fc92bfbff6f499fa97">main</a> (int argc, char *argv[])</td></tr>
<tr class="memdesc:a0ddf1224851353fc92bfbff6f499fa97"><td class="mdescLeft">&#160;</td><td class="mdescRight">Main simulation function.  <a href="#a0ddf1224851353fc92bfbff6f499fa97">More...</a><br/></td></tr>
<tr class="separator:a0ddf1224851353fc92bfbff6f499fa97"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Macro Definition Documentation</h2>
<a class="anchor" id="ab0894b9662d0cf6a3b811e45bbe1db40"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define BANDWIDTH_REGION_A&#160;&#160;&#160;8700000</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="_qcn_sim_c_c_grid_8cpp_source.html#l00033">33</a> of file <a class="el" href="_qcn_sim_c_c_grid_8cpp_source.html">QcnSimCCGrid.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="ae6e3963e0e76a616b5c808947dd2c776"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define BANDWIDTH_REGION_B&#160;&#160;&#160;3000000</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="_qcn_sim_c_c_grid_8cpp_source.html#l00035">35</a> of file <a class="el" href="_qcn_sim_c_c_grid_8cpp_source.html">QcnSimCCGrid.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a6d8b96ff7d0e91f1f6b522ed49e5b6ba"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define BANDWIDTH_REGION_C&#160;&#160;&#160;5000000</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="_qcn_sim_c_c_grid_8cpp_source.html#l00037">37</a> of file <a class="el" href="_qcn_sim_c_c_grid_8cpp_source.html">QcnSimCCGrid.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="af258c278dfb4bc81d35ddb8bdd4ba5f2"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define BANDWIDTH_REGION_D&#160;&#160;&#160;5000000</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="_qcn_sim_c_c_grid_8cpp_source.html#l00039">39</a> of file <a class="el" href="_qcn_sim_c_c_grid_8cpp_source.html">QcnSimCCGrid.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a240f0b8cc47ce12ef3257c8addcc1796"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define BANDWIDTH_REGION_FAKE&#160;&#160;&#160;6000000</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="_qcn_sim_c_c_grid_8cpp_source.html#l00041">41</a> of file <a class="el" href="_qcn_sim_c_c_grid_8cpp_source.html">QcnSimCCGrid.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a7b6b7d6f58a8b7237a92fd3bc195aa66"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define INPUT_FILENAME&#160;&#160;&#160;&quot;..\\Release\\map C high (4 regions) no failure 1.csv&quot;</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Simulation for CCGrid 2014 paper. </p>
<dl class="section author"><dt>Author</dt><dd>Marcos Portnoi </dd></dl>
<dl class="section date"><dt>Date</dt><dd>November 2013</dd></dl>
<dl class="section copyright"><dt>Copyright</dt><dd>Copyright (C) 2013 University of Delaware. </dd>
<dd>
QCNSim uses elements of TARVOS simulator, Copyright (C) 2005, 2006, 2007 Marcos Portnoi. </dd></dl>
<dl class="section user"><dt></dt><dd>This file is part of QCNSim. QCNSim is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.<br/>
 QCNSim is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.<br/>
 You should have received a copy of the GNU Lesser General Public License along with QCNSim. If not, see <a href="http://www.gnu.org/licenses/">http://www.gnu.org/licenses/</a>.</dd></dl>
<p>Scenario B, simulation 1, no network failures. One BOINC server/destination per region ID. </p>

<p>Definition at line <a class="el" href="_qcn_sim_c_c_grid_8cpp_source.html#l00030">30</a> of file <a class="el" href="_qcn_sim_c_c_grid_8cpp_source.html">QcnSimCCGrid.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a8e4724f509582fd412b65aa79d7ebe1e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define LINK_DOWN_TIME&#160;&#160;&#160;1.0</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="_qcn_sim_c_c_grid_8cpp_source.html#l00060">60</a> of file <a class="el" href="_qcn_sim_c_c_grid_8cpp_source.html">QcnSimCCGrid.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a121218679b2ffe08b52abaf30eb20ab0"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define LINK_FAILURE&#160;&#160;&#160;false</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="_qcn_sim_c_c_grid_8cpp_source.html#l00061">61</a> of file <a class="el" href="_qcn_sim_c_c_grid_8cpp_source.html">QcnSimCCGrid.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a0c175fc00c53b14b300e30a773b91b94"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define MAX_SIMULATION_TIME&#160;&#160;&#160;50.0</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="_qcn_sim_c_c_grid_8cpp_source.html#l00059">59</a> of file <a class="el" href="_qcn_sim_c_c_grid_8cpp_source.html">QcnSimCCGrid.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a07852dca1831c7ab358e25355f6c21a0"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define OUTPUT_FILENAME&#160;&#160;&#160;std::string(<a class="el" href="_qcn_sim_c_c_grid_8cpp.html#a7b6b7d6f58a8b7237a92fd3bc195aa66">INPUT_FILENAME</a>) + &quot;-output.csv&quot;</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="_qcn_sim_c_c_grid_8cpp_source.html#l00031">31</a> of file <a class="el" href="_qcn_sim_c_c_grid_8cpp_source.html">QcnSimCCGrid.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a4bdc13655ee7bf4cf0e66d16e22dc103"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define PDU_SIZE&#160;&#160;&#160;512</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="_qcn_sim_c_c_grid_8cpp_source.html#l00032">32</a> of file <a class="el" href="_qcn_sim_c_c_grid_8cpp_source.html">QcnSimCCGrid.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a31c31bc14c0a859acd22b782f55e38a2"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define PRINT_TRACE&#160;&#160;&#160;false</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="_qcn_sim_c_c_grid_8cpp_source.html#l00064">64</a> of file <a class="el" href="_qcn_sim_c_c_grid_8cpp_source.html">QcnSimCCGrid.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a7847900052c44e0128d7aed8e33fd57d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define PROPAGATION_REGION_A&#160;&#160;&#160;0.03</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="_qcn_sim_c_c_grid_8cpp_source.html#l00034">34</a> of file <a class="el" href="_qcn_sim_c_c_grid_8cpp_source.html">QcnSimCCGrid.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a38f9c28c77024724afcc614d2dcdc74e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define PROPAGATION_REGION_B&#160;&#160;&#160;0.05</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="_qcn_sim_c_c_grid_8cpp_source.html#l00036">36</a> of file <a class="el" href="_qcn_sim_c_c_grid_8cpp_source.html">QcnSimCCGrid.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a9db42258da8f8ad11ab4453a7dd637b3"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define PROPAGATION_REGION_C&#160;&#160;&#160;0.05</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="_qcn_sim_c_c_grid_8cpp_source.html#l00038">38</a> of file <a class="el" href="_qcn_sim_c_c_grid_8cpp_source.html">QcnSimCCGrid.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a010f0a83db91d4ff135cf281696ebfc1"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define PROPAGATION_REGION_D&#160;&#160;&#160;0.05</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="_qcn_sim_c_c_grid_8cpp_source.html#l00040">40</a> of file <a class="el" href="_qcn_sim_c_c_grid_8cpp_source.html">QcnSimCCGrid.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a25003fc4313519b1e49e07940e1a2f9c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define PROPAGATION_REGION_FAKE&#160;&#160;&#160;0.07</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="_qcn_sim_c_c_grid_8cpp_source.html#l00042">42</a> of file <a class="el" href="_qcn_sim_c_c_grid_8cpp_source.html">QcnSimCCGrid.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a9749cc2e7e187e1f302d0158151b293d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define REGION_A_DESTINATION&#160;&#160;&#160;(<a class="el" href="_qcn_sim_c_c_grid_8cpp.html#a0bf380a4597f3e8e702b3f4fcb31a17e">REGION_A_ID</a> * 10)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="_qcn_sim_c_c_grid_8cpp_source.html#l00053">53</a> of file <a class="el" href="_qcn_sim_c_c_grid_8cpp_source.html">QcnSimCCGrid.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a0bf380a4597f3e8e702b3f4fcb31a17e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define REGION_A_ID&#160;&#160;&#160;1</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="_qcn_sim_c_c_grid_8cpp_source.html#l00043">43</a> of file <a class="el" href="_qcn_sim_c_c_grid_8cpp_source.html">QcnSimCCGrid.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a58c3c5ada720c7d45f1dfeaf181e4e0f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define REGION_A_SOURCE&#160;&#160;&#160;<a class="el" href="_qcn_sim_c_c_grid_8cpp.html#a0bf380a4597f3e8e702b3f4fcb31a17e">REGION_A_ID</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="_qcn_sim_c_c_grid_8cpp_source.html#l00048">48</a> of file <a class="el" href="_qcn_sim_c_c_grid_8cpp_source.html">QcnSimCCGrid.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a34ba3a12764116b2aaa23d3165305295"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define REGION_B_DESTINATION&#160;&#160;&#160;(<a class="el" href="_qcn_sim_c_c_grid_8cpp.html#acdb16bb6018a7c85d3160c15e9d4089a">REGION_B_ID</a> * 10)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="_qcn_sim_c_c_grid_8cpp_source.html#l00054">54</a> of file <a class="el" href="_qcn_sim_c_c_grid_8cpp_source.html">QcnSimCCGrid.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="acdb16bb6018a7c85d3160c15e9d4089a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define REGION_B_ID&#160;&#160;&#160;2</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="_qcn_sim_c_c_grid_8cpp_source.html#l00044">44</a> of file <a class="el" href="_qcn_sim_c_c_grid_8cpp_source.html">QcnSimCCGrid.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a453b0cdfacfb82674c0846ffcbd42460"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define REGION_B_SOURCE&#160;&#160;&#160;<a class="el" href="_qcn_sim_c_c_grid_8cpp.html#acdb16bb6018a7c85d3160c15e9d4089a">REGION_B_ID</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="_qcn_sim_c_c_grid_8cpp_source.html#l00049">49</a> of file <a class="el" href="_qcn_sim_c_c_grid_8cpp_source.html">QcnSimCCGrid.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="ac4f0f4199bf2f7c707e8ac44ef80dc95"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define REGION_C_DESTINATION&#160;&#160;&#160;(<a class="el" href="_qcn_sim_c_c_grid_8cpp.html#aacd5aeeefd3d2cdd0a2735dbf01fe1c3">REGION_C_ID</a> * 10)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="_qcn_sim_c_c_grid_8cpp_source.html#l00055">55</a> of file <a class="el" href="_qcn_sim_c_c_grid_8cpp_source.html">QcnSimCCGrid.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="aacd5aeeefd3d2cdd0a2735dbf01fe1c3"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define REGION_C_ID&#160;&#160;&#160;5</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="_qcn_sim_c_c_grid_8cpp_source.html#l00045">45</a> of file <a class="el" href="_qcn_sim_c_c_grid_8cpp_source.html">QcnSimCCGrid.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a94fa0bdb40ee4da20e3d8d227276a1c0"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define REGION_C_SOURCE&#160;&#160;&#160;<a class="el" href="_qcn_sim_c_c_grid_8cpp.html#aacd5aeeefd3d2cdd0a2735dbf01fe1c3">REGION_C_ID</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="_qcn_sim_c_c_grid_8cpp_source.html#l00050">50</a> of file <a class="el" href="_qcn_sim_c_c_grid_8cpp_source.html">QcnSimCCGrid.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="af03badce48baec1f9a831cfff15eb8bf"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define REGION_D_DESTINATION&#160;&#160;&#160;(<a class="el" href="_qcn_sim_c_c_grid_8cpp.html#adee06583f1b8b5964a4793f98f3f4bc7">REGION_D_ID</a> * 10)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="_qcn_sim_c_c_grid_8cpp_source.html#l00056">56</a> of file <a class="el" href="_qcn_sim_c_c_grid_8cpp_source.html">QcnSimCCGrid.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="adee06583f1b8b5964a4793f98f3f4bc7"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define REGION_D_ID&#160;&#160;&#160;4</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="_qcn_sim_c_c_grid_8cpp_source.html#l00046">46</a> of file <a class="el" href="_qcn_sim_c_c_grid_8cpp_source.html">QcnSimCCGrid.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="ace2cec71fb9a16df31aafa9b250e5648"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define REGION_D_SOURCE&#160;&#160;&#160;<a class="el" href="_qcn_sim_c_c_grid_8cpp.html#adee06583f1b8b5964a4793f98f3f4bc7">REGION_D_ID</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="_qcn_sim_c_c_grid_8cpp_source.html#l00051">51</a> of file <a class="el" href="_qcn_sim_c_c_grid_8cpp_source.html">QcnSimCCGrid.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a07f75b830427f4fa3f743119b555dd41"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define REGION_FAKE_DESTINATION&#160;&#160;&#160;(<a class="el" href="_qcn_sim_c_c_grid_8cpp.html#a14bd15123cf3bb9a64bf52c1aa988549">REGION_FAKE_ID</a> * 10)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="_qcn_sim_c_c_grid_8cpp_source.html#l00057">57</a> of file <a class="el" href="_qcn_sim_c_c_grid_8cpp_source.html">QcnSimCCGrid.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a14bd15123cf3bb9a64bf52c1aa988549"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define REGION_FAKE_ID&#160;&#160;&#160;888</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="_qcn_sim_c_c_grid_8cpp_source.html#l00047">47</a> of file <a class="el" href="_qcn_sim_c_c_grid_8cpp_source.html">QcnSimCCGrid.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="ac3df39d3fa181f7564443145014c76d2"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define REGION_FAKE_SOURCE&#160;&#160;&#160;<a class="el" href="_qcn_sim_c_c_grid_8cpp.html#a14bd15123cf3bb9a64bf52c1aa988549">REGION_FAKE_ID</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="_qcn_sim_c_c_grid_8cpp_source.html#l00052">52</a> of file <a class="el" href="_qcn_sim_c_c_grid_8cpp_source.html">QcnSimCCGrid.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a21723b939da0ed1a32b68488677cef98"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define REROUTE_TRAFFIC&#160;&#160;&#160;false</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="_qcn_sim_c_c_grid_8cpp_source.html#l00063">63</a> of file <a class="el" href="_qcn_sim_c_c_grid_8cpp_source.html">QcnSimCCGrid.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a44d8a25b9f10356063cd072a556efa22"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define REROUTE_TRAFFIC_TIME&#160;&#160;&#160;1.0</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="_qcn_sim_c_c_grid_8cpp_source.html#l00062">62</a> of file <a class="el" href="_qcn_sim_c_c_grid_8cpp_source.html">QcnSimCCGrid.cpp</a>.</p>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="a146501a7eea204bdae387e00e88031fb"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">std::shared_ptr&lt;<a class="el" href="class_link.html">Link</a>&gt; findLinkByNodeB </td>
          <td>(</td>
          <td class="paramtype">std::map&lt; unsigned int, std::shared_ptr&lt; <a class="el" href="class_link.html">Link</a> &gt;&gt;&#160;</td>
          <td class="paramname"><em>linkMap</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::shared_ptr&lt; <a class="el" href="class_node.html">Node</a> &gt;&#160;</td>
          <td class="paramname"><em>nodeB</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Finds and returns a link pointer form a map of links, given the nodeB. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">linkMap</td><td>Reference to map of links. </td></tr>
    <tr><td class="paramname">nodeB</td><td>Pointer to nodeB from a link.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Pointer to found link, or nullptr if not found. </dd></dl>

<p>Definition at line <a class="el" href="_qcn_sim_c_c_grid_8cpp_source.html#l00074">74</a> of file <a class="el" href="_qcn_sim_c_c_grid_8cpp_source.html">QcnSimCCGrid.cpp</a>.</p>
<div class="fragment"><div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;                                                                                                                  {</div>
<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;    <span class="keywordflow">for</span> (<span class="keyword">auto</span> linkMapIterator : linkMap) {</div>
<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;        <span class="keywordflow">if</span> (linkMapIterator.second-&gt;getNodeB() == nodeB) {</div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;            <span class="keywordflow">return</span> linkMapIterator.second;</div>
<div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;        }</div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;    }</div>
<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;    <span class="keywordflow">return</span> <span class="keyword">nullptr</span>; <span class="comment">// Not found. This will cause an error later in the code.</span></div>
<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;}</div>
</div><!-- fragment -->
</div>
</div>
<a class="anchor" id="a0ddf1224851353fc92bfbff6f499fa97"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int main </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>argc</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>argv</em>[]&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Main simulation function. </p>

<p>Definition at line <a class="el" href="_qcn_sim_c_c_grid_8cpp_source.html#l00086">86</a> of file <a class="el" href="_qcn_sim_c_c_grid_8cpp_source.html">QcnSimCCGrid.cpp</a>.</p>
<div class="fragment"><div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;                                 {</div>
<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;    std::ofstream outputFile; <span class="comment">// Output file handle</span></div>
<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;    std::ifstream inputFile; <span class="comment">// Input file handle.</span></div>
<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;    std::string line; <span class="comment">// Line to be read from input file.</span></div>
<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;    std::map&lt;unsigned int, std::shared_ptr&lt;QcnSensorTrafficGenerator&gt;&gt; qcnSensorTrafficGeneratorMap; <span class="comment">// Map to hold all qcnSensorTrafficGenerators.</span></div>
<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;    std::shared_ptr&lt;SeismicEventData&gt; seismicEventData(<span class="keyword">nullptr</span>); <span class="comment">// Will hold seismic event objects instantiated from file.</span></div>
<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;    std::map&lt;unsigned int, std::shared_ptr&lt;Node&gt;&gt; nodeMap;</div>
<div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;    std::map&lt;unsigned int, std::shared_ptr&lt;Link&gt;&gt; linkMap;</div>
<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;    std::map&lt;unsigned int, std::vector&lt;std::shared_ptr&lt;Entity&gt;&gt;&gt; explicitRouteMap;</div>
<div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;    std::shared_ptr&lt;Link&gt; link(<span class="keyword">nullptr</span>);</div>
<div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;    std::uniform_int_distribution&lt;int&gt; uniformVariate(0,1); <span class="comment">// 50% probability generator.</span></div>
<div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;    </div>
<div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;    <span class="keywordtype">bool</span> simulationEnded = <span class="keyword">false</span>; <span class="comment">// Indicates whether the simulation has ended.</span></div>
<div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;    <a class="code" href="class_event.html">Event</a> currentEvent;</div>
<div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;    <span class="keywordtype">bool</span> rerouteTrafficEventFulfilled = <span class="keyword">false</span>; <span class="comment">// Indicates whether this event was already fulfilled.</span></div>
<div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;    <span class="keywordtype">bool</span> setLinkDownEventFulfilled = <span class="keyword">false</span>; <span class="comment">// Indicates whether this event was already fulfilled.</span></div>
<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;    <span class="comment">//std::shared_ptr&lt;ProtocolDataUnit&gt; pduFromEventEntity(nullptr);</span></div>
<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;    std::shared_ptr&lt;ProtocolDataUnit&gt; pduFromEventEntityNonConst(<span class="keyword">nullptr</span>); <span class="comment">// Will handle the pdu extracted from Event objects, removed const-ness.</span></div>
<div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;    </div>
<div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;    <span class="comment">// SimulatorGlobals, instantiate here.</span></div>
<div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;    <a class="code" href="class_simulator_globals.html">SimulatorGlobals</a> simulatorGlobals(0.0, 0.0, <span class="keyword">false</span>, <span class="stringliteral">&quot;CCGrid 2014 - Map C, no failure.&quot;</span>);</div>
<div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;    <span class="comment">// Scheduler.</span></div>
<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;    <a class="code" href="class_scheduler.html">Scheduler</a> scheduler(simulatorGlobals);</div>
<div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;</div>
<div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;    <span class="comment">// Create 4 nodes, one for each region ID. Insert into node Map. Key is Region ID or Region Source Node.</span></div>
<div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;    <span class="keywordflow">if</span> (<a class="code" href="_qcn_sim_c_c_grid_8cpp.html#a31c31bc14c0a859acd22b782f55e38a2">PRINT_TRACE</a>) {</div>
<div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;        std::cout &lt;&lt; <span class="stringliteral">&quot;Creating nodes...&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;    }</div>
<div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;    <span class="comment">// 3 Meta nodes, regions C and D share one. 3 Boinc servers/destination nodes.</span></div>
<div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;    <span class="comment">//nodeMap.insert(std::pair&lt;unsigned int, std::shared_ptr&lt;Node&gt;&gt;(REGION_A_SOURCE, std::make_shared&lt;Node&gt;(Node(simulatorGlobals))));</span></div>
<div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;    <span class="comment">//nodeMap.insert(std::pair&lt;unsigned int, std::shared_ptr&lt;Node&gt;&gt;(REGION_B_SOURCE, std::make_shared&lt;Node&gt;(Node(simulatorGlobals))));</span></div>
<div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;    <span class="comment">//nodeMap.insert(std::pair&lt;unsigned int, std::shared_ptr&lt;Node&gt;&gt;(REGION_C_SOURCE, std::make_shared&lt;Node&gt;(Node(simulatorGlobals))));</span></div>
<div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;<span class="comment"></span>    <span class="comment">//nodeMap.insert(std::pair&lt;unsigned int, std::shared_ptr&lt;Node&gt;&gt;(REGION_D_SOURCE, nodeMap.at(REGION_C_SOURCE))); // Note that this entry maps to same Node as Region C.</span></div>
<div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;<span class="comment"></span>    <span class="comment">//nodeMap.insert(std::pair&lt;unsigned int, std::shared_ptr&lt;Node&gt;&gt;(REGION_A_DESTINATION, std::make_shared&lt;Node&gt;(Node(simulatorGlobals))));</span></div>
<div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;    <span class="comment">//nodeMap.insert(std::pair&lt;unsigned int, std::shared_ptr&lt;Node&gt;&gt;(REGION_B_DESTINATION, std::make_shared&lt;Node&gt;(Node(simulatorGlobals))));</span></div>
<div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;    <span class="comment">//nodeMap.insert(std::pair&lt;unsigned int, std::shared_ptr&lt;Node&gt;&gt;(REGION_C_DESTINATION, std::make_shared&lt;Node&gt;(Node(simulatorGlobals))));</span></div>
<div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;<span class="comment"></span>    <span class="comment">//nodeMap.insert(std::pair&lt;unsigned int, std::shared_ptr&lt;Node&gt;&gt;(REGION_D_DESTINATION, nodeMap.at(REGION_C_DESTINATION))); // Note that his entry maps to the same node as Region C.</span></div>
<div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;    </div>
<div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;    <span class="comment">// One meta-node, one BOINC server.</span></div>
<div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;    nodeMap.insert(std::pair&lt;<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>, std::shared_ptr&lt;Node&gt;&gt;(<a class="code" href="_qcn_sim_c_c_grid_8cpp.html#a58c3c5ada720c7d45f1dfeaf181e4e0f">REGION_A_SOURCE</a>, std::make_shared&lt;Node&gt;(<a class="code" href="class_node.html">Node</a>(simulatorGlobals))));</div>
<div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;    nodeMap.insert(std::pair&lt;<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>, std::shared_ptr&lt;Node&gt;&gt;(<a class="code" href="_qcn_sim_c_c_grid_8cpp.html#a453b0cdfacfb82674c0846ffcbd42460">REGION_B_SOURCE</a>, nodeMap.at(<a class="code" href="_qcn_sim_c_c_grid_8cpp.html#a58c3c5ada720c7d45f1dfeaf181e4e0f">REGION_A_SOURCE</a>)));</div>
<div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;    nodeMap.insert(std::pair&lt;<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>, std::shared_ptr&lt;Node&gt;&gt;(<a class="code" href="_qcn_sim_c_c_grid_8cpp.html#a94fa0bdb40ee4da20e3d8d227276a1c0">REGION_C_SOURCE</a>, nodeMap.at(<a class="code" href="_qcn_sim_c_c_grid_8cpp.html#a58c3c5ada720c7d45f1dfeaf181e4e0f">REGION_A_SOURCE</a>)));</div>
<div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;    nodeMap.insert(std::pair&lt;<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>, std::shared_ptr&lt;Node&gt;&gt;(<a class="code" href="_qcn_sim_c_c_grid_8cpp.html#ace2cec71fb9a16df31aafa9b250e5648">REGION_D_SOURCE</a>, nodeMap.at(<a class="code" href="_qcn_sim_c_c_grid_8cpp.html#a58c3c5ada720c7d45f1dfeaf181e4e0f">REGION_A_SOURCE</a>))); </div>
<div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;    nodeMap.insert(std::pair&lt;<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>, std::shared_ptr&lt;Node&gt;&gt;(<a class="code" href="_qcn_sim_c_c_grid_8cpp.html#ac3df39d3fa181f7564443145014c76d2">REGION_FAKE_SOURCE</a>, std::make_shared&lt;Node&gt;(<a class="code" href="class_node.html">Node</a>(simulatorGlobals)))); </div>
<div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;    <span class="comment">// Create 4 nodes to represent the destination BOINC servers; key will be regionID * 10. Note that if a destination already exists</span></div>
<div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;    <span class="comment">// (case of two regions sharing one destination), the element is simply not inserted.</span></div>
<div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;    nodeMap.insert(std::pair&lt;<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>, std::shared_ptr&lt;Node&gt;&gt;(<a class="code" href="_qcn_sim_c_c_grid_8cpp.html#a9749cc2e7e187e1f302d0158151b293d">REGION_A_DESTINATION</a>, std::make_shared&lt;Node&gt;(<a class="code" href="class_node.html">Node</a>(simulatorGlobals))));</div>
<div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;    nodeMap.insert(std::pair&lt;<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>, std::shared_ptr&lt;Node&gt;&gt;(<a class="code" href="_qcn_sim_c_c_grid_8cpp.html#a34ba3a12764116b2aaa23d3165305295">REGION_B_DESTINATION</a>, nodeMap.at(<a class="code" href="_qcn_sim_c_c_grid_8cpp.html#a9749cc2e7e187e1f302d0158151b293d">REGION_A_DESTINATION</a>)));</div>
<div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;    nodeMap.insert(std::pair&lt;<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>, std::shared_ptr&lt;Node&gt;&gt;(<a class="code" href="_qcn_sim_c_c_grid_8cpp.html#ac4f0f4199bf2f7c707e8ac44ef80dc95">REGION_C_DESTINATION</a>, nodeMap.at(<a class="code" href="_qcn_sim_c_c_grid_8cpp.html#a9749cc2e7e187e1f302d0158151b293d">REGION_A_DESTINATION</a>)));</div>
<div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;    nodeMap.insert(std::pair&lt;<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>, std::shared_ptr&lt;Node&gt;&gt;(<a class="code" href="_qcn_sim_c_c_grid_8cpp.html#af03badce48baec1f9a831cfff15eb8bf">REGION_D_DESTINATION</a>, nodeMap.at(<a class="code" href="_qcn_sim_c_c_grid_8cpp.html#a9749cc2e7e187e1f302d0158151b293d">REGION_A_DESTINATION</a>)));</div>
<div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;    nodeMap.insert(std::pair&lt;<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>, std::shared_ptr&lt;Node&gt;&gt;(<a class="code" href="_qcn_sim_c_c_grid_8cpp.html#a07f75b830427f4fa3f743119b555dd41">REGION_FAKE_DESTINATION</a>, std::make_shared&lt;Node&gt;(<a class="code" href="class_node.html">Node</a>(simulatorGlobals))));</div>
<div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;    </div>
<div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;    <span class="keywordflow">if</span> (<a class="code" href="_qcn_sim_c_c_grid_8cpp.html#a31c31bc14c0a859acd22b782f55e38a2">PRINT_TRACE</a>) {</div>
<div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;        std::cout &lt;&lt; nodeMap.size() &lt;&lt; <span class="stringliteral">&quot; nodes created.&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;    }</div>
<div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;</div>
<div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;    <span class="comment">// Create explicitRoutes. Key is Region ID. If regions share same source or destination, explicit routes might be the same, which is ok.</span></div>
<div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;    <span class="keywordflow">if</span> (<a class="code" href="_qcn_sim_c_c_grid_8cpp.html#a31c31bc14c0a859acd22b782f55e38a2">PRINT_TRACE</a>) {</div>
<div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;        std::cout &lt;&lt; <span class="stringliteral">&quot;Creating explicit routes...&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;    }</div>
<div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;    <span class="comment">// 3 explicit routes connecting meta-nodes to destinations.</span></div>
<div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;    <span class="comment">//explicitRouteMap.insert(std::pair&lt;unsigned int, std::vector&lt;std::shared_ptr&lt;Entity&gt;&gt;&gt;(REGION_A_ID, std::vector&lt;std::shared_ptr&lt;Entity&gt;&gt;({ nodeMap.at(REGION_A_SOURCE), nodeMap.at(REGION_A_DESTINATION) })));</span></div>
<div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;    <span class="comment">//explicitRouteMap.insert(std::pair&lt;unsigned int, std::vector&lt;std::shared_ptr&lt;Entity&gt;&gt;&gt;(REGION_B_ID, std::vector&lt;std::shared_ptr&lt;Entity&gt;&gt;({ nodeMap.at(REGION_B_SOURCE), nodeMap.at(REGION_B_DESTINATION) })));</span></div>
<div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;    <span class="comment">//explicitRouteMap.insert(std::pair&lt;unsigned int, std::vector&lt;std::shared_ptr&lt;Entity&gt;&gt;&gt;(REGION_C_ID, std::vector&lt;std::shared_ptr&lt;Entity&gt;&gt;({ nodeMap.at(REGION_C_SOURCE), nodeMap.at(REGION_C_DESTINATION) })));</span></div>
<div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;<span class="comment"></span>    <span class="comment">//explicitRouteMap.insert(std::pair&lt;unsigned int, std::vector&lt;std::shared_ptr&lt;Entity&gt;&gt;&gt;(REGION_D_ID, explicitRouteMap.at(REGION_C_ID))); // Same route as Region C.</span></div>
<div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;    </div>
<div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;    <span class="comment">// One explicit route between meta-node and destination.</span></div>
<div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;    explicitRouteMap.insert(std::pair&lt;<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>, std::vector&lt;std::shared_ptr&lt;Entity&gt;&gt;&gt;(<a class="code" href="_qcn_sim_c_c_grid_8cpp.html#a0bf380a4597f3e8e702b3f4fcb31a17e">REGION_A_ID</a>, std::vector&lt;std::shared_ptr&lt;Entity&gt;&gt;({ nodeMap.at(<a class="code" href="_qcn_sim_c_c_grid_8cpp.html#a58c3c5ada720c7d45f1dfeaf181e4e0f">REGION_A_SOURCE</a>), nodeMap.at(<a class="code" href="_qcn_sim_c_c_grid_8cpp.html#a9749cc2e7e187e1f302d0158151b293d">REGION_A_DESTINATION</a>) })));</div>
<div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;    explicitRouteMap.insert(std::pair&lt;<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>, std::vector&lt;std::shared_ptr&lt;Entity&gt;&gt;&gt;(<a class="code" href="_qcn_sim_c_c_grid_8cpp.html#acdb16bb6018a7c85d3160c15e9d4089a">REGION_B_ID</a>, explicitRouteMap.at(<a class="code" href="_qcn_sim_c_c_grid_8cpp.html#a0bf380a4597f3e8e702b3f4fcb31a17e">REGION_A_ID</a>)));</div>
<div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;    explicitRouteMap.insert(std::pair&lt;<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>, std::vector&lt;std::shared_ptr&lt;Entity&gt;&gt;&gt;(<a class="code" href="_qcn_sim_c_c_grid_8cpp.html#aacd5aeeefd3d2cdd0a2735dbf01fe1c3">REGION_C_ID</a>, explicitRouteMap.at(<a class="code" href="_qcn_sim_c_c_grid_8cpp.html#a0bf380a4597f3e8e702b3f4fcb31a17e">REGION_A_ID</a>)));</div>
<div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;    explicitRouteMap.insert(std::pair&lt;<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>, std::vector&lt;std::shared_ptr&lt;Entity&gt;&gt;&gt;(<a class="code" href="_qcn_sim_c_c_grid_8cpp.html#adee06583f1b8b5964a4793f98f3f4bc7">REGION_D_ID</a>, explicitRouteMap.at(<a class="code" href="_qcn_sim_c_c_grid_8cpp.html#a0bf380a4597f3e8e702b3f4fcb31a17e">REGION_A_ID</a>))); <span class="comment">// Same route as Region C.</span></div>
<div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;    explicitRouteMap.insert(std::pair&lt;<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>, std::vector&lt;std::shared_ptr&lt;Entity&gt;&gt;&gt;(<a class="code" href="_qcn_sim_c_c_grid_8cpp.html#a14bd15123cf3bb9a64bf52c1aa988549">REGION_FAKE_ID</a>, std::vector&lt;std::shared_ptr&lt;Entity&gt;&gt;({ nodeMap.at(<a class="code" href="_qcn_sim_c_c_grid_8cpp.html#ac3df39d3fa181f7564443145014c76d2">REGION_FAKE_SOURCE</a>), nodeMap.at(<a class="code" href="_qcn_sim_c_c_grid_8cpp.html#a07f75b830427f4fa3f743119b555dd41">REGION_FAKE_DESTINATION</a>) })));</div>
<div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;    </div>
<div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;    <span class="keywordflow">if</span> (<a class="code" href="_qcn_sim_c_c_grid_8cpp.html#a31c31bc14c0a859acd22b782f55e38a2">PRINT_TRACE</a>) {</div>
<div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;        std::cout &lt;&lt; explicitRouteMap.size() &lt;&lt; <span class="stringliteral">&quot; explicit routes created.&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;    }</div>
<div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160;</div>
<div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160;    <span class="comment">// Create simplex links to connect each region node to its destination. Put into link map. The key will be the destination node key.</span></div>
<div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;    <span class="comment">// If key already exists (link already created?), then insertion will simply not do anything.</span></div>
<div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;    <span class="keywordflow">if</span> (<a class="code" href="_qcn_sim_c_c_grid_8cpp.html#a31c31bc14c0a859acd22b782f55e38a2">PRINT_TRACE</a>) {</div>
<div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;        std::cout &lt;&lt; <span class="stringliteral">&quot;Creating links...&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160;    }</div>
<div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160;    <span class="comment">// 3 Links connecting meta-nodes to destinations.</span></div>
<div class="line"><a name="l00174"></a><span class="lineno">  174</span>&#160;    <span class="comment">//linkMap.insert(std::pair&lt;unsigned int, std::shared_ptr&lt;Link&gt;&gt;(REGION_A_DESTINATION, std::make_shared&lt;Link&gt;(Link(nodeMap.at(REGION_A_SOURCE), nodeMap.at(REGION_A_DESTINATION),</span></div>
<div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160;    <span class="comment">//  BANDWIDTH_REGION_A, PROPAGATION_REGION_A, simulatorGlobals, scheduler, &quot;link region A&quot;))));</span></div>
<div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160;    <span class="comment">//linkMap.insert(std::pair&lt;unsigned int, std::shared_ptr&lt;Link&gt;&gt;(REGION_B_DESTINATION, std::make_shared&lt;Link&gt;(Link(nodeMap.at(REGION_B_SOURCE), nodeMap.at(REGION_B_DESTINATION),</span></div>
<div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160;    <span class="comment">//  BANDWIDTH_REGION_B, PROPAGATION_REGION_B, simulatorGlobals, scheduler, &quot;link region B&quot;))));</span></div>
<div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160;    <span class="comment">//linkMap.insert(std::pair&lt;unsigned int, std::shared_ptr&lt;Link&gt;&gt;(REGION_C_DESTINATION, std::make_shared&lt;Link&gt;(Link(nodeMap.at(REGION_C_SOURCE), nodeMap.at(REGION_C_DESTINATION),</span></div>
<div class="line"><a name="l00179"></a><span class="lineno">  179</span>&#160;    <span class="comment">//  BANDWIDTH_REGION_C, PROPAGATION_REGION_C, simulatorGlobals, scheduler, &quot;link region C and D&quot;))));</span></div>
<div class="line"><a name="l00182"></a><span class="lineno">  182</span>&#160;<span class="comment"></span>    <span class="comment">//linkMap.insert(std::pair&lt;unsigned int, std::shared_ptr&lt;Link&gt;&gt;(REGION_D_DESTINATION, linkMap.at(REGION_C_DESTINATION))); // Same link as Region C.</span></div>
<div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160;    </div>
<div class="line"><a name="l00184"></a><span class="lineno">  184</span>&#160;    <span class="comment">// One link connecting one meta-node to destination.</span></div>
<div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;    linkMap.insert(std::pair&lt;<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>, std::shared_ptr&lt;Link&gt;&gt;(<a class="code" href="_qcn_sim_c_c_grid_8cpp.html#a9749cc2e7e187e1f302d0158151b293d">REGION_A_DESTINATION</a>, std::make_shared&lt;Link&gt;(<a class="code" href="class_link.html">Link</a>(nodeMap.at(<a class="code" href="_qcn_sim_c_c_grid_8cpp.html#a58c3c5ada720c7d45f1dfeaf181e4e0f">REGION_A_SOURCE</a>), nodeMap.at(<a class="code" href="_qcn_sim_c_c_grid_8cpp.html#a9749cc2e7e187e1f302d0158151b293d">REGION_A_DESTINATION</a>),</div>
<div class="line"><a name="l00186"></a><span class="lineno">  186</span>&#160;        <a class="code" href="_qcn_sim_c_c_grid_8cpp.html#ab0894b9662d0cf6a3b811e45bbe1db40">BANDWIDTH_REGION_A</a>, <a class="code" href="_qcn_sim_c_c_grid_8cpp.html#a7847900052c44e0128d7aed8e33fd57d">PROPAGATION_REGION_A</a>, simulatorGlobals, scheduler, <span class="stringliteral">&quot;link region A-B-C-D&quot;</span>))));</div>
<div class="line"><a name="l00187"></a><span class="lineno">  187</span>&#160;    linkMap.insert(std::pair&lt;<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>, std::shared_ptr&lt;Link&gt;&gt;(<a class="code" href="_qcn_sim_c_c_grid_8cpp.html#a34ba3a12764116b2aaa23d3165305295">REGION_B_DESTINATION</a>, linkMap.at(<a class="code" href="_qcn_sim_c_c_grid_8cpp.html#a9749cc2e7e187e1f302d0158151b293d">REGION_A_DESTINATION</a>))); </div>
<div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160;    linkMap.insert(std::pair&lt;<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>, std::shared_ptr&lt;Link&gt;&gt;(<a class="code" href="_qcn_sim_c_c_grid_8cpp.html#ac4f0f4199bf2f7c707e8ac44ef80dc95">REGION_C_DESTINATION</a>, linkMap.at(<a class="code" href="_qcn_sim_c_c_grid_8cpp.html#a9749cc2e7e187e1f302d0158151b293d">REGION_A_DESTINATION</a>))); </div>
<div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;    linkMap.insert(std::pair&lt;<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>, std::shared_ptr&lt;Link&gt;&gt;(<a class="code" href="_qcn_sim_c_c_grid_8cpp.html#af03badce48baec1f9a831cfff15eb8bf">REGION_D_DESTINATION</a>, linkMap.at(<a class="code" href="_qcn_sim_c_c_grid_8cpp.html#a9749cc2e7e187e1f302d0158151b293d">REGION_A_DESTINATION</a>)));</div>
<div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160;    linkMap.insert(std::pair&lt;<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>, std::shared_ptr&lt;Link&gt;&gt;(<a class="code" href="_qcn_sim_c_c_grid_8cpp.html#a07f75b830427f4fa3f743119b555dd41">REGION_FAKE_DESTINATION</a>, std::make_shared&lt;Link&gt;(<a class="code" href="class_link.html">Link</a>(nodeMap.at(<a class="code" href="_qcn_sim_c_c_grid_8cpp.html#ac3df39d3fa181f7564443145014c76d2">REGION_FAKE_SOURCE</a>), nodeMap.at(<a class="code" href="_qcn_sim_c_c_grid_8cpp.html#a07f75b830427f4fa3f743119b555dd41">REGION_FAKE_DESTINATION</a>),</div>
<div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160;        <a class="code" href="_qcn_sim_c_c_grid_8cpp.html#a240f0b8cc47ce12ef3257c8addcc1796">BANDWIDTH_REGION_FAKE</a>, <a class="code" href="_qcn_sim_c_c_grid_8cpp.html#a25003fc4313519b1e49e07940e1a2f9c">PROPAGATION_REGION_FAKE</a>, simulatorGlobals, scheduler, <span class="stringliteral">&quot;link fake-rerouting&quot;</span>))));</div>
<div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160;    </div>
<div class="line"><a name="l00193"></a><span class="lineno">  193</span>&#160;    <span class="keywordflow">if</span> (<a class="code" href="_qcn_sim_c_c_grid_8cpp.html#a31c31bc14c0a859acd22b782f55e38a2">PRINT_TRACE</a>) {</div>
<div class="line"><a name="l00194"></a><span class="lineno">  194</span>&#160;        std::cout &lt;&lt; linkMap.size() &lt;&lt; <span class="stringliteral">&quot; links created.&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><a name="l00195"></a><span class="lineno">  195</span>&#160;    }</div>
<div class="line"><a name="l00196"></a><span class="lineno">  196</span>&#160;            </div>
<div class="line"><a name="l00197"></a><span class="lineno">  197</span>&#160;    <span class="comment">// Create seismic events, put them into event chain, and create QCN sensor traffic generators from the unique qcnExplorerSensorIds.</span></div>
<div class="line"><a name="l00198"></a><span class="lineno">  198</span>&#160;    <span class="comment">// Open file for input.</span></div>
<div class="line"><a name="l00199"></a><span class="lineno">  199</span>&#160;    <span class="comment">//inputFile.open(INPUT_FILENAME, std::ios::in);</span></div>
<div class="line"><a name="l00200"></a><span class="lineno">  200</span>&#160;    inputFile.open(argv[1], std::ios::in);  <span class="comment">// Using command line argument.</span></div>
<div class="line"><a name="l00201"></a><span class="lineno">  201</span>&#160;</div>
<div class="line"><a name="l00202"></a><span class="lineno">  202</span>&#160;    <span class="comment">// Now read all file. Discard line if it begins with string &quot;ID&quot;, meaning this is the header</span></div>
<div class="line"><a name="l00203"></a><span class="lineno">  203</span>&#160;    <span class="keywordflow">if</span> (<a class="code" href="_qcn_sim_c_c_grid_8cpp.html#a31c31bc14c0a859acd22b782f55e38a2">PRINT_TRACE</a>) {</div>
<div class="line"><a name="l00204"></a><span class="lineno">  204</span>&#160;        std::cout &lt;&lt; <span class="stringliteral">&quot;Reading file to create seismic events and QCN sensor traffic generators...&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><a name="l00205"></a><span class="lineno">  205</span>&#160;    }</div>
<div class="line"><a name="l00206"></a><span class="lineno">  206</span>&#160;    <span class="keywordflow">while</span> (std::getline(inputFile, line)) {</div>
<div class="line"><a name="l00207"></a><span class="lineno">  207</span>&#160;        <span class="keywordflow">if</span> (line.substr(0, 2) != <span class="stringliteral">&quot;ID&quot;</span>) {</div>
<div class="line"><a name="l00208"></a><span class="lineno">  208</span>&#160;            <span class="comment">// It is not the header. Create seismic event object.</span></div>
<div class="line"><a name="l00209"></a><span class="lineno">  209</span>&#160;            seismicEventData = std::make_shared&lt;SeismicEventData&gt;(<a class="code" href="class_seismic_event_data.html">SeismicEventData</a>(line, <span class="charliteral">&#39;,&#39;</span>));</div>
<div class="line"><a name="l00210"></a><span class="lineno">  210</span>&#160;            <span class="comment">// If QCN sensor with same sensor id does not yet exist, instantiate one and put into map.</span></div>
<div class="line"><a name="l00211"></a><span class="lineno">  211</span>&#160;            <span class="keywordflow">if</span> (qcnSensorTrafficGeneratorMap.find(seismicEventData-&gt;qcnExplorerSensorId) == qcnSensorTrafficGeneratorMap.end()) {</div>
<div class="line"><a name="l00212"></a><span class="lineno">  212</span>&#160;                qcnSensorTrafficGeneratorMap.insert(std::pair&lt;<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>, std::shared_ptr&lt;QcnSensorTrafficGenerator&gt;&gt;(seismicEventData-&gt;qcnExplorerSensorId,</div>
<div class="line"><a name="l00213"></a><span class="lineno">  213</span>&#160;                    std::make_shared&lt;QcnSensorTrafficGenerator&gt;(<a class="code" href="class_qcn_sensor_traffic_generator.html">QcnSensorTrafficGenerator</a>(simulatorGlobals, scheduler,</div>
<div class="line"><a name="l00214"></a><span class="lineno">  214</span>&#160;                    <a class="code" href="_event_type_8h.html#a2628ea8d12e8b2563c32f05dc7fff6faaa8dbff7900a4d5c983629de5a6f58d78">EventType::TRAFFIC_GENERATOR_ARRIVAL</a>, seismicEventData, nodeMap.at(seismicEventData-&gt;regionId), nodeMap.at(seismicEventData-&gt;regionId * 10),</div>
<div class="line"><a name="l00215"></a><span class="lineno">  215</span>&#160;                    1, seismicEventData-&gt;latitude, seismicEventData-&gt;longitude, seismicEventData-&gt;qcnExplorerSensorId, seismicEventData-&gt;regionId))));</div>
<div class="line"><a name="l00216"></a><span class="lineno">  216</span>&#160;                qcnSensorTrafficGeneratorMap.at(seismicEventData-&gt;qcnExplorerSensorId)-&gt;turnOn(); <span class="comment">// Have the generators ON by default.</span></div>
<div class="line"><a name="l00217"></a><span class="lineno">  217</span>&#160;            }</div>
<div class="line"><a name="l00218"></a><span class="lineno">  218</span>&#160;            scheduler.schedule(<a class="code" href="class_event.html">Event</a>(seismicEventData-&gt;eventTime, <a class="code" href="_event_type_8h.html#a2628ea8d12e8b2563c32f05dc7fff6faaaef0e420b0327dd399b8206026228e6f">EventType::SEISMIC_EVENT_DETECTION</a>, seismicEventData));</div>
<div class="line"><a name="l00219"></a><span class="lineno">  219</span>&#160;        }</div>
<div class="line"><a name="l00220"></a><span class="lineno">  220</span>&#160;    }</div>
<div class="line"><a name="l00221"></a><span class="lineno">  221</span>&#160;    <span class="keywordflow">if</span> (<a class="code" href="_qcn_sim_c_c_grid_8cpp.html#a31c31bc14c0a859acd22b782f55e38a2">PRINT_TRACE</a>) {</div>
<div class="line"><a name="l00222"></a><span class="lineno">  222</span>&#160;        std::cout &lt;&lt; scheduler.getChainSize() &lt;&lt; <span class="stringliteral">&quot; seismic events entered into event chain.\n&quot;</span> &lt;&lt; qcnSensorTrafficGeneratorMap.size() &lt;&lt;</div>
<div class="line"><a name="l00223"></a><span class="lineno">  223</span>&#160;            <span class="stringliteral">&quot; QCN sensor traffic generators created.&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><a name="l00224"></a><span class="lineno">  224</span>&#160;    }</div>
<div class="line"><a name="l00225"></a><span class="lineno">  225</span>&#160;    inputFile.close();</div>
<div class="line"><a name="l00226"></a><span class="lineno">  226</span>&#160;</div>
<div class="line"><a name="l00227"></a><span class="lineno">  227</span>&#160;    <span class="comment">// Prepare output file for collecting general statistics.</span></div>
<div class="line"><a name="l00228"></a><span class="lineno">  228</span>&#160;    outputFile.open(std::string(argv[1]) + <span class="stringliteral">&quot;-output.csv&quot;</span>);</div>
<div class="line"><a name="l00229"></a><span class="lineno">  229</span>&#160;    outputFile &lt;&lt; <span class="stringliteral">&quot;link,ID,lat,lng,mag,obsvTime,hypoCentDist,regionID,deliverTime&quot;</span> &lt;&lt; std::endl; <span class="comment">// Write the header.</span></div>
<div class="line"><a name="l00230"></a><span class="lineno">  230</span>&#160;</div>
<div class="line"><a name="l00231"></a><span class="lineno">  231</span>&#160;    <span class="comment">// Schedule end of simulation.</span></div>
<div class="line"><a name="l00232"></a><span class="lineno">  232</span>&#160;    scheduler.schedule(<a class="code" href="class_event.html">Event</a>(<a class="code" href="_qcn_sim_c_c_grid_8cpp.html#a0c175fc00c53b14b300e30a773b91b94">MAX_SIMULATION_TIME</a>, <a class="code" href="_event_type_8h.html#a2628ea8d12e8b2563c32f05dc7fff6faa96955421ee351c21ef8b232bc9d8998d">EventType::END_SIMULATION</a>, <span class="keyword">nullptr</span>));</div>
<div class="line"><a name="l00233"></a><span class="lineno">  233</span>&#160;    </div>
<div class="line"><a name="l00234"></a><span class="lineno">  234</span>&#160;    <span class="comment">// Main while-switch-case structure.</span></div>
<div class="line"><a name="l00235"></a><span class="lineno">  235</span>&#160;    <span class="keywordflow">if</span> (<a class="code" href="_qcn_sim_c_c_grid_8cpp.html#a31c31bc14c0a859acd22b782f55e38a2">PRINT_TRACE</a>) {</div>
<div class="line"><a name="l00236"></a><span class="lineno">  236</span>&#160;        std::cout &lt;&lt; <span class="stringliteral">&quot;Beginning simulation...&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><a name="l00237"></a><span class="lineno">  237</span>&#160;    }</div>
<div class="line"><a name="l00238"></a><span class="lineno">  238</span>&#160;    <span class="keywordflow">while</span> (!simulationEnded) {</div>
<div class="line"><a name="l00239"></a><span class="lineno">  239</span>&#160;        currentEvent = scheduler.cause(); <span class="comment">// Fetch next event from scheduler.</span></div>
<div class="line"><a name="l00240"></a><span class="lineno">  240</span>&#160;        <span class="comment">//pduFromEventEntity = std::dynamic_pointer_cast&lt;const ProtocolDataUnit&gt;(currentEvent.entity); // Entity from event converted to PDU.</span></div>
<div class="line"><a name="l00241"></a><span class="lineno">  241</span>&#160;        pduFromEventEntityNonConst = std::dynamic_pointer_cast&lt;<a class="code" href="class_protocol_data_unit.html">ProtocolDataUnit</a>&gt;(std::const_pointer_cast&lt;<a class="code" href="class_entity.html">Entity</a>&gt;(currentEvent.<a class="code" href="class_event.html#a97fb29e53119ce8179674bf46f23d24e">entity</a>)); <span class="comment">// Same PDU as above, but non-const.</span></div>
<div class="line"><a name="l00242"></a><span class="lineno">  242</span>&#160;        </div>
<div class="line"><a name="l00243"></a><span class="lineno">  243</span>&#160;        <span class="comment">// Now decide what to do.</span></div>
<div class="line"><a name="l00244"></a><span class="lineno">  244</span>&#160;        <span class="keywordflow">switch</span> (currentEvent.<a class="code" href="class_event.html#a491887ba31c3f39b85930214133236fd">eventType</a>) {</div>
<div class="line"><a name="l00245"></a><span class="lineno">  245</span>&#160;            <span class="keywordflow">case</span> <a class="code" href="_event_type_8h.html#a2628ea8d12e8b2563c32f05dc7fff6faaa6f2ce7722792bb5a4c114a8d4f3b7f4">EventType::REROUTE_QCN_TRAFFIC</a>:</div>
<div class="line"><a name="l00246"></a><span class="lineno">  246</span>&#160;                <span class="comment">// This event is only scheduled if macro REROUTE_TRAFFIC is true.</span></div>
<div class="line"><a name="l00247"></a><span class="lineno">  247</span>&#160;                <span class="comment">// Flag is set, and then traffic arrivals will be directly modified.</span></div>
<div class="line"><a name="l00248"></a><span class="lineno">  248</span>&#160;                <span class="comment">// Test here if traffic is to be forcibly rerouted. Use 50% probability. If true, modify seismic data region ID and source/destination nodes.</span></div>
<div class="line"><a name="l00249"></a><span class="lineno">  249</span>&#160;                <span class="keywordflow">for</span> (<span class="keyword">auto</span> qcnSensorTrafficGeneratorIterator : qcnSensorTrafficGeneratorMap) {</div>
<div class="line"><a name="l00250"></a><span class="lineno">  250</span>&#160;                    <span class="keywordflow">if</span> (uniformVariate(simulatorGlobals.getRandomNumberGeneratorEngineInstance()) == 1) {</div>
<div class="line"><a name="l00251"></a><span class="lineno">  251</span>&#160;                        <span class="comment">// Change qcn sensor generator with 50% probability.</span></div>
<div class="line"><a name="l00252"></a><span class="lineno">  252</span>&#160;                        qcnSensorTrafficGeneratorIterator.second-&gt;setSource(nodeMap.at(<a class="code" href="_qcn_sim_c_c_grid_8cpp.html#ac3df39d3fa181f7564443145014c76d2">REGION_FAKE_SOURCE</a>));</div>
<div class="line"><a name="l00253"></a><span class="lineno">  253</span>&#160;                        qcnSensorTrafficGeneratorIterator.second-&gt;setDestination(nodeMap.at(<a class="code" href="_qcn_sim_c_c_grid_8cpp.html#a07f75b830427f4fa3f743119b555dd41">REGION_FAKE_DESTINATION</a>));</div>
<div class="line"><a name="l00254"></a><span class="lineno">  254</span>&#160;                        qcnSensorTrafficGeneratorIterator.second-&gt;setRegionId(<a class="code" href="_qcn_sim_c_c_grid_8cpp.html#a14bd15123cf3bb9a64bf52c1aa988549">REGION_FAKE_ID</a>);</div>
<div class="line"><a name="l00255"></a><span class="lineno">  255</span>&#160;                    }</div>
<div class="line"><a name="l00256"></a><span class="lineno">  256</span>&#160;                }</div>
<div class="line"><a name="l00257"></a><span class="lineno">  257</span>&#160;                <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00258"></a><span class="lineno">  258</span>&#160;</div>
<div class="line"><a name="l00259"></a><span class="lineno">  259</span>&#160;            <span class="keywordflow">case</span> <a class="code" href="_event_type_8h.html#a2628ea8d12e8b2563c32f05dc7fff6faa96955421ee351c21ef8b232bc9d8998d">EventType::END_SIMULATION</a>:</div>
<div class="line"><a name="l00260"></a><span class="lineno">  260</span>&#160;                <span class="keywordflow">if</span> (<a class="code" href="_qcn_sim_c_c_grid_8cpp.html#a31c31bc14c0a859acd22b782f55e38a2">PRINT_TRACE</a>) {</div>
<div class="line"><a name="l00261"></a><span class="lineno">  261</span>&#160;                    std::cout &lt;&lt; <span class="stringliteral">&quot;EventType::END_SIMULATION&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><a name="l00262"></a><span class="lineno">  262</span>&#160;                }</div>
<div class="line"><a name="l00263"></a><span class="lineno">  263</span>&#160;                simulationEnded = <span class="keyword">true</span>;</div>
<div class="line"><a name="l00264"></a><span class="lineno">  264</span>&#160;                <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00265"></a><span class="lineno">  265</span>&#160;</div>
<div class="line"><a name="l00266"></a><span class="lineno">  266</span>&#160;            <span class="keywordflow">case</span> <a class="code" href="_event_type_8h.html#a2628ea8d12e8b2563c32f05dc7fff6faa7b83d89c39b12ab66465087a3118a3ac">EventType::END_TRANSMISSION_PROPAGATE_PDU_AT_LINK</a>:</div>
<div class="line"><a name="l00267"></a><span class="lineno">  267</span>&#160;                <span class="keywordflow">if</span> (<a class="code" href="_qcn_sim_c_c_grid_8cpp.html#a31c31bc14c0a859acd22b782f55e38a2">PRINT_TRACE</a>) {</div>
<div class="line"><a name="l00268"></a><span class="lineno">  268</span>&#160;                    std::cout &lt;&lt; <span class="stringliteral">&quot;EventType::END_TRANSMISSION_PROPAGATE_PDU_AT_LINK&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><a name="l00269"></a><span class="lineno">  269</span>&#160;                }</div>
<div class="line"><a name="l00270"></a><span class="lineno">  270</span>&#160;                <span class="comment">// End link transmission here and schedule end of propagation.</span></div>
<div class="line"><a name="l00271"></a><span class="lineno">  271</span>&#160;                <a class="code" href="_qcn_sim_c_c_grid_8cpp.html#a146501a7eea204bdae387e00e88031fb">findLinkByNodeB</a>(linkMap, std::dynamic_pointer_cast&lt;Node&gt;(pduFromEventEntityNonConst-&gt;next))-&gt;propagatePdu(<a class="code" href="_event_type_8h.html#a2628ea8d12e8b2563c32f05dc7fff6faa3767fd6cb828899aafbe567387a1c823">EventType::END_PROPAGATION_AT_LINK</a>, pduFromEventEntityNonConst);</div>
<div class="line"><a name="l00272"></a><span class="lineno">  272</span>&#160;                <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00273"></a><span class="lineno">  273</span>&#160;</div>
<div class="line"><a name="l00274"></a><span class="lineno">  274</span>&#160;            <span class="keywordflow">case</span> <a class="code" href="_event_type_8h.html#a2628ea8d12e8b2563c32f05dc7fff6faa9b31ea954f59af0f85d1ac9b65607772">EventType::PDUTOKEN_ARRIVAL_AT_NODE</a>:</div>
<div class="line"><a name="l00275"></a><span class="lineno">  275</span>&#160;                <span class="keywordflow">if</span> (<a class="code" href="_qcn_sim_c_c_grid_8cpp.html#a31c31bc14c0a859acd22b782f55e38a2">PRINT_TRACE</a>) {</div>
<div class="line"><a name="l00276"></a><span class="lineno">  276</span>&#160;                    std::cout &lt;&lt; <span class="stringliteral">&quot;EventType::PDUTOKEN_ARRIVAL_AT_NODE&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><a name="l00277"></a><span class="lineno">  277</span>&#160;                }</div>
<div class="line"><a name="l00278"></a><span class="lineno">  278</span>&#160;                <span class="comment">// Ends propagation. If this node is just the source node, return will be nullptr, do nothing.</span></div>
<div class="line"><a name="l00279"></a><span class="lineno">  279</span>&#160;                link = <a class="code" href="_qcn_sim_c_c_grid_8cpp.html#a146501a7eea204bdae387e00e88031fb">findLinkByNodeB</a>(linkMap, std::dynamic_pointer_cast&lt;Node&gt;(pduFromEventEntityNonConst-&gt;next));</div>
<div class="line"><a name="l00280"></a><span class="lineno">  280</span>&#160;                <span class="keywordflow">if</span> (link != <span class="keyword">nullptr</span>) {</div>
<div class="line"><a name="l00281"></a><span class="lineno">  281</span>&#160;                    link-&gt;endPropagation(pduFromEventEntityNonConst);</div>
<div class="line"><a name="l00282"></a><span class="lineno">  282</span>&#160;                }</div>
<div class="line"><a name="l00283"></a><span class="lineno">  283</span>&#160;                <span class="comment">//findLinkByNodeB(linkMap, std::dynamic_pointer_cast&lt;Node&gt;(pduFromEventEntityNonConst-&gt;next))-&gt;endPropagation(pduFromEventEntityNonConst);</span></div>
<div class="line"><a name="l00284"></a><span class="lineno">  284</span>&#160;                </div>
<div class="line"><a name="l00285"></a><span class="lineno">  285</span>&#160;                <span class="comment">// Now forward the PDU to the next hop. Test, however, if this is the destination node, in which case output data to a file.</span></div>
<div class="line"><a name="l00286"></a><span class="lineno">  286</span>&#160;                <span class="keywordflow">if</span> (std::dynamic_pointer_cast&lt;Node&gt;(pduFromEventEntityNonConst-&gt;next)-&gt;processAndForward(pduFromEventEntityNonConst) != <a class="code" href="_node_return_type_8h.html#a653f4b3757de7a3613c60211493c60c1ab9804cb278b1f322f56a216720a67eec">NodeReturnType::FINAL_DESTINATION</a>) {</div>
<div class="line"><a name="l00287"></a><span class="lineno">  287</span>&#160;                    <span class="comment">// Not final destination. Schedule transmission event.</span></div>
<div class="line"><a name="l00288"></a><span class="lineno">  288</span>&#160;                    <span class="keywordflow">if</span> (<a class="code" href="_qcn_sim_c_c_grid_8cpp.html#a31c31bc14c0a859acd22b782f55e38a2">PRINT_TRACE</a>) {</div>
<div class="line"><a name="l00289"></a><span class="lineno">  289</span>&#160;                        std::cout &lt;&lt; <span class="stringliteral">&quot;EventType::PDUTOKEN_ARRIVAL_AT_NODE: not final destination.&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><a name="l00290"></a><span class="lineno">  290</span>&#160;                    }</div>
<div class="line"><a name="l00291"></a><span class="lineno">  291</span>&#160;                    scheduler.schedule(<a class="code" href="class_event.html">Event</a>(0.0, <a class="code" href="_event_type_8h.html#a2628ea8d12e8b2563c32f05dc7fff6faa2f5f57b148fe966a93f58ed00865a12b">EventType::REQUEST_PDU_TRANSMISSION_AT_LINK</a>, pduFromEventEntityNonConst));</div>
<div class="line"><a name="l00292"></a><span class="lineno">  292</span>&#160;                } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00293"></a><span class="lineno">  293</span>&#160;                    <span class="comment">// It is the final destination. Output received data to file.</span></div>
<div class="line"><a name="l00294"></a><span class="lineno">  294</span>&#160;                    <span class="comment">// Or deliver it to some Facility modeling a BOINC server.</span></div>
<div class="line"><a name="l00295"></a><span class="lineno">  295</span>&#160;                    <span class="keywordflow">if</span> (<a class="code" href="_qcn_sim_c_c_grid_8cpp.html#a31c31bc14c0a859acd22b782f55e38a2">PRINT_TRACE</a>) {</div>
<div class="line"><a name="l00296"></a><span class="lineno">  296</span>&#160;                        std::cout &lt;&lt; <span class="stringliteral">&quot;EventType::PDUTOKEN_ARRIVAL_AT_NODE: final destination.&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><a name="l00297"></a><span class="lineno">  297</span>&#160;                    }</div>
<div class="line"><a name="l00298"></a><span class="lineno">  298</span>&#160;                    seismicEventData = std::dynamic_pointer_cast&lt;<a class="code" href="class_seismic_event_data.html">SeismicEventData</a>&gt;(pduFromEventEntityNonConst-&gt;associatedEntity);</div>
<div class="line"><a name="l00299"></a><span class="lineno">  299</span>&#160;                    <span class="comment">// Comment out the next line after debugging.</span></div>
<div class="line"><a name="l00300"></a><span class="lineno">  300</span>&#160;                    outputFile &lt;&lt; findLinkByNodeB(linkMap, std::dynamic_pointer_cast&lt;Node&gt;(pduFromEventEntityNonConst-&gt;next))-&gt;getName() &lt;&lt; <span class="stringliteral">&quot;,&quot;</span>; <span class="comment">// For debug purposes only.</span></div>
<div class="line"><a name="l00301"></a><span class="lineno">  301</span>&#160;                    outputFile &lt;&lt; seismicEventData-&gt;<a class="code" href="class_seismic_event_data.html#a3cfac81095ec0d5b827fce06c443c006">qcnExplorerSensorId</a> &lt;&lt; <span class="stringliteral">&quot;,&quot;</span>;</div>
<div class="line"><a name="l00302"></a><span class="lineno">  302</span>&#160;                    outputFile &lt;&lt; std::setprecision(10) &lt;&lt; seismicEventData-&gt;latitude &lt;&lt; <span class="stringliteral">&quot;,&quot;</span>;</div>
<div class="line"><a name="l00303"></a><span class="lineno">  303</span>&#160;                    outputFile &lt;&lt; std::setprecision(10) &lt;&lt; seismicEventData-&gt;longitude &lt;&lt; <span class="stringliteral">&quot;,&quot;</span>;</div>
<div class="line"><a name="l00304"></a><span class="lineno">  304</span>&#160;                    outputFile &lt;&lt; std::setprecision(10) &lt;&lt; seismicEventData-&gt;magnitude &lt;&lt; <span class="stringliteral">&quot;,&quot;</span>;</div>
<div class="line"><a name="l00305"></a><span class="lineno">  305</span>&#160;                    outputFile &lt;&lt; std::setprecision(10) &lt;&lt; seismicEventData-&gt;eventTime &lt;&lt; <span class="stringliteral">&quot;,&quot;</span>;</div>
<div class="line"><a name="l00306"></a><span class="lineno">  306</span>&#160;                    outputFile &lt;&lt; std::setprecision(10) &lt;&lt; seismicEventData-&gt;distance &lt;&lt; <span class="stringliteral">&quot;,&quot;</span>;</div>
<div class="line"><a name="l00307"></a><span class="lineno">  307</span>&#160;                    outputFile &lt;&lt; seismicEventData-&gt;regionId &lt;&lt; <span class="stringliteral">&quot;,&quot;</span>;</div>
<div class="line"><a name="l00308"></a><span class="lineno">  308</span>&#160;                    outputFile &lt;&lt; std::setprecision(10) &lt;&lt; simulatorGlobals.getCurrentAbsoluteTime() &lt;&lt; std::endl; <span class="comment">// Timestamp of delivery at destination.</span></div>
<div class="line"><a name="l00309"></a><span class="lineno">  309</span>&#160;                }</div>
<div class="line"><a name="l00310"></a><span class="lineno">  310</span>&#160;                <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00311"></a><span class="lineno">  311</span>&#160;</div>
<div class="line"><a name="l00312"></a><span class="lineno">  312</span>&#160;            <span class="keywordflow">case</span> <a class="code" href="_event_type_8h.html#a2628ea8d12e8b2563c32f05dc7fff6faa2f5f57b148fe966a93f58ed00865a12b">EventType::REQUEST_PDU_TRANSMISSION_AT_LINK</a>:</div>
<div class="line"><a name="l00313"></a><span class="lineno">  313</span>&#160;                <span class="keywordflow">if</span> (<a class="code" href="_qcn_sim_c_c_grid_8cpp.html#a31c31bc14c0a859acd22b782f55e38a2">PRINT_TRACE</a>) {</div>
<div class="line"><a name="l00314"></a><span class="lineno">  314</span>&#160;                    std::cout &lt;&lt; <span class="stringliteral">&quot;EventType::REQUEST_PDU_TRANSMISSION_AT_LINK&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><a name="l00315"></a><span class="lineno">  315</span>&#160;                }</div>
<div class="line"><a name="l00316"></a><span class="lineno">  316</span>&#160;                <span class="comment">// Decide which link to use based on next field of PDU.</span></div>
<div class="line"><a name="l00317"></a><span class="lineno">  317</span>&#160;                <a class="code" href="_qcn_sim_c_c_grid_8cpp.html#a146501a7eea204bdae387e00e88031fb">findLinkByNodeB</a>(linkMap, std::dynamic_pointer_cast&lt;Node&gt;(pduFromEventEntityNonConst-&gt;next))-&gt;transmitPdu(<a class="code" href="_event_type_8h.html#a2628ea8d12e8b2563c32f05dc7fff6faa2f5f57b148fe966a93f58ed00865a12b">EventType::REQUEST_PDU_TRANSMISSION_AT_LINK</a>,</div>
<div class="line"><a name="l00318"></a><span class="lineno">  318</span>&#160;                                                                                                                 <a class="code" href="_event_type_8h.html#a2628ea8d12e8b2563c32f05dc7fff6faa7b83d89c39b12ab66465087a3118a3ac">EventType::END_TRANSMISSION_PROPAGATE_PDU_AT_LINK</a>, pduFromEventEntityNonConst);</div>
<div class="line"><a name="l00319"></a><span class="lineno">  319</span>&#160;                <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00320"></a><span class="lineno">  320</span>&#160;</div>
<div class="line"><a name="l00321"></a><span class="lineno">  321</span>&#160;            <span class="keywordflow">case</span> <a class="code" href="_event_type_8h.html#a2628ea8d12e8b2563c32f05dc7fff6faaaef0e420b0327dd399b8206026228e6f">EventType::SEISMIC_EVENT_DETECTION</a>:</div>
<div class="line"><a name="l00322"></a><span class="lineno">  322</span>&#160;                <span class="keywordflow">if</span> (<a class="code" href="_qcn_sim_c_c_grid_8cpp.html#a31c31bc14c0a859acd22b782f55e38a2">PRINT_TRACE</a>) {</div>
<div class="line"><a name="l00323"></a><span class="lineno">  323</span>&#160;                    std::cout &lt;&lt; <span class="stringliteral">&quot;EventType::SEISMIC_EVENT_DETECTION&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><a name="l00324"></a><span class="lineno">  324</span>&#160;                }</div>
<div class="line"><a name="l00325"></a><span class="lineno">  325</span>&#160;                <span class="comment">// When creating traffic instance, attach tokenContents (seismicEventData) and explicitRoute.</span></div>
<div class="line"><a name="l00326"></a><span class="lineno">  326</span>&#160;                <span class="comment">// QCN sensor ID will the the key for the map. Upon seismic event, trigger message to send to BOINC server at destination.</span></div>
<div class="line"><a name="l00327"></a><span class="lineno">  327</span>&#160;                seismicEventData = std::dynamic_pointer_cast&lt;<a class="code" href="class_seismic_event_data.html">SeismicEventData</a>&gt;(std::const_pointer_cast&lt;<a class="code" href="class_entity.html">Entity</a>&gt;(currentEvent.<a class="code" href="class_event.html#a97fb29e53119ce8179674bf46f23d24e">entity</a>)); <span class="comment">// Get seismic event data.</span></div>
<div class="line"><a name="l00328"></a><span class="lineno">  328</span>&#160;                qcnSensorTrafficGeneratorMap.at(seismicEventData-&gt;qcnExplorerSensorId)-&gt;createInstanceTrafficEventPdu(<a class="code" href="_qcn_sim_c_c_grid_8cpp.html#a4bdc13655ee7bf4cf0e66d16e22dc103">PDU_SIZE</a>, seismicEventData,</div>
<div class="line"><a name="l00329"></a><span class="lineno">  329</span>&#160;                      explicitRouteMap.at(qcnSensorTrafficGeneratorMap.at(seismicEventData-&gt;qcnExplorerSensorId)-&gt;getRegionId()));              </div>
<div class="line"><a name="l00330"></a><span class="lineno">  330</span>&#160;                <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00331"></a><span class="lineno">  331</span>&#160;</div>
<div class="line"><a name="l00332"></a><span class="lineno">  332</span>&#160;            <span class="keywordflow">case</span> <a class="code" href="_event_type_8h.html#a2628ea8d12e8b2563c32f05dc7fff6faa9bc56863b9fa691d4c06f5ff30f02420">EventType::SET_LINK_DOWN</a>:</div>
<div class="line"><a name="l00333"></a><span class="lineno">  333</span>&#160;                <span class="keywordflow">if</span> (<a class="code" href="_qcn_sim_c_c_grid_8cpp.html#a31c31bc14c0a859acd22b782f55e38a2">PRINT_TRACE</a>) {</div>
<div class="line"><a name="l00334"></a><span class="lineno">  334</span>&#160;                    std::cout &lt;&lt; <span class="stringliteral">&quot;EventType::SET_LINK_DOWN&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><a name="l00335"></a><span class="lineno">  335</span>&#160;                }</div>
<div class="line"><a name="l00336"></a><span class="lineno">  336</span>&#160;                <span class="comment">// Set some link down here at specific time.</span></div>
<div class="line"><a name="l00337"></a><span class="lineno">  337</span>&#160;                linkMap.at(<a class="code" href="_qcn_sim_c_c_grid_8cpp.html#a9749cc2e7e187e1f302d0158151b293d">REGION_A_DESTINATION</a>)-&gt;setDown();</div>
<div class="line"><a name="l00338"></a><span class="lineno">  338</span>&#160;                <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00339"></a><span class="lineno">  339</span>&#160;</div>
<div class="line"><a name="l00340"></a><span class="lineno">  340</span>&#160;            <span class="keywordflow">case</span> <a class="code" href="_event_type_8h.html#a2628ea8d12e8b2563c32f05dc7fff6faaa8dbff7900a4d5c983629de5a6f58d78">EventType::TRAFFIC_GENERATOR_ARRIVAL</a>:</div>
<div class="line"><a name="l00341"></a><span class="lineno">  341</span>&#160;                <span class="keywordflow">if</span> (<a class="code" href="_qcn_sim_c_c_grid_8cpp.html#a31c31bc14c0a859acd22b782f55e38a2">PRINT_TRACE</a>) {</div>
<div class="line"><a name="l00342"></a><span class="lineno">  342</span>&#160;                    std::cout &lt;&lt; <span class="stringliteral">&quot;EventType::TRAFFIC_GENERATOR_ARRIVAL&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><a name="l00343"></a><span class="lineno">  343</span>&#160;                }</div>
<div class="line"><a name="l00344"></a><span class="lineno">  344</span>&#160;                <span class="comment">// Arrival from traffic generator.</span></div>
<div class="line"><a name="l00345"></a><span class="lineno">  345</span>&#160;                <span class="comment">// Actually, all operations here can be handled by PDUTOKEN_ARRIVAL_AT_NODE. Just schedule this as next event and pass PDU.</span></div>
<div class="line"><a name="l00346"></a><span class="lineno">  346</span>&#160;                <span class="comment">// If desired, insert additional random propagation latency here, by scheduling PDUTOKEN_ARRIVAL_AT_NODE with the additional delay.</span></div>
<div class="line"><a name="l00347"></a><span class="lineno">  347</span>&#160;                <span class="comment">// Do this only after generating QCN traffic, and the respective PDU arriving at the region meta-node.</span></div>
<div class="line"><a name="l00348"></a><span class="lineno">  348</span>&#160;                <span class="comment">// For now, not adding any extra latency (0.0).</span></div>
<div class="line"><a name="l00349"></a><span class="lineno">  349</span>&#160;                scheduler.schedule(<a class="code" href="class_event.html">Event</a>(0.0, <a class="code" href="_event_type_8h.html#a2628ea8d12e8b2563c32f05dc7fff6faa9b31ea954f59af0f85d1ac9b65607772">EventType::PDUTOKEN_ARRIVAL_AT_NODE</a>, pduFromEventEntityNonConst));</div>
<div class="line"><a name="l00350"></a><span class="lineno">  350</span>&#160;                <span class="comment">// Schedule reroute traffic event is macro is set. Only once!</span></div>
<div class="line"><a name="l00351"></a><span class="lineno">  351</span>&#160;                <span class="keywordflow">if</span> (<a class="code" href="_qcn_sim_c_c_grid_8cpp.html#a21723b939da0ed1a32b68488677cef98">REROUTE_TRAFFIC</a> &amp;&amp; !rerouteTrafficEventFulfilled) {</div>
<div class="line"><a name="l00352"></a><span class="lineno">  352</span>&#160;                    scheduler.schedule(<a class="code" href="class_event.html">Event</a>(<a class="code" href="_qcn_sim_c_c_grid_8cpp.html#a44d8a25b9f10356063cd072a556efa22">REROUTE_TRAFFIC_TIME</a>, <a class="code" href="_event_type_8h.html#a2628ea8d12e8b2563c32f05dc7fff6faaa6f2ce7722792bb5a4c114a8d4f3b7f4">EventType::REROUTE_QCN_TRAFFIC</a>, <span class="keyword">nullptr</span>));</div>
<div class="line"><a name="l00353"></a><span class="lineno">  353</span>&#160;                    rerouteTrafficEventFulfilled = <span class="keyword">true</span>; <span class="comment">// Avoid doing this scheduling again.</span></div>
<div class="line"><a name="l00354"></a><span class="lineno">  354</span>&#160;                }</div>
<div class="line"><a name="l00355"></a><span class="lineno">  355</span>&#160;                <span class="comment">// Schedule link down event if macro is set. Only once!</span></div>
<div class="line"><a name="l00356"></a><span class="lineno">  356</span>&#160;                <span class="keywordflow">if</span> (<a class="code" href="_qcn_sim_c_c_grid_8cpp.html#a121218679b2ffe08b52abaf30eb20ab0">LINK_FAILURE</a> &amp;&amp; !setLinkDownEventFulfilled) {</div>
<div class="line"><a name="l00357"></a><span class="lineno">  357</span>&#160;                    scheduler.schedule(<a class="code" href="class_event.html">Event</a>(<a class="code" href="_qcn_sim_c_c_grid_8cpp.html#a8e4724f509582fd412b65aa79d7ebe1e">LINK_DOWN_TIME</a>, <a class="code" href="_event_type_8h.html#a2628ea8d12e8b2563c32f05dc7fff6faa9bc56863b9fa691d4c06f5ff30f02420">EventType::SET_LINK_DOWN</a>, <span class="keyword">nullptr</span>));</div>
<div class="line"><a name="l00358"></a><span class="lineno">  358</span>&#160;                    setLinkDownEventFulfilled = <span class="keyword">true</span>; <span class="comment">// Avoid doing this scheduling again.</span></div>
<div class="line"><a name="l00359"></a><span class="lineno">  359</span>&#160;                }</div>
<div class="line"><a name="l00360"></a><span class="lineno">  360</span>&#160;                <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00361"></a><span class="lineno">  361</span>&#160;</div>
<div class="line"><a name="l00362"></a><span class="lineno">  362</span>&#160;            <span class="keywordflow">case</span> <a class="code" href="_event_type_8h.html#a2628ea8d12e8b2563c32f05dc7fff6faa3767fd6cb828899aafbe567387a1c823">EventType::END_PROPAGATION_AT_LINK</a>:</div>
<div class="line"><a name="l00363"></a><span class="lineno">  363</span>&#160;                <span class="keywordflow">if</span> (<a class="code" href="_qcn_sim_c_c_grid_8cpp.html#a31c31bc14c0a859acd22b782f55e38a2">PRINT_TRACE</a>) {</div>
<div class="line"><a name="l00364"></a><span class="lineno">  364</span>&#160;                    std::cout &lt;&lt; <span class="stringliteral">&quot;EventType::END_PROPAGATION_AT_LINK&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><a name="l00365"></a><span class="lineno">  365</span>&#160;                }</div>
<div class="line"><a name="l00366"></a><span class="lineno">  366</span>&#160;                <span class="comment">// Ends propagation. Just deliver the PDU to the node by scheduling the next event.</span></div>
<div class="line"><a name="l00367"></a><span class="lineno">  367</span>&#160;                scheduler.schedule(<a class="code" href="class_event.html">Event</a>(0.0, <a class="code" href="_event_type_8h.html#a2628ea8d12e8b2563c32f05dc7fff6faa9b31ea954f59af0f85d1ac9b65607772">EventType::PDUTOKEN_ARRIVAL_AT_NODE</a>, pduFromEventEntityNonConst));</div>
<div class="line"><a name="l00368"></a><span class="lineno">  368</span>&#160;                <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00369"></a><span class="lineno">  369</span>&#160;</div>
<div class="line"><a name="l00370"></a><span class="lineno">  370</span>&#160;            <span class="keywordflow">default</span>:</div>
<div class="line"><a name="l00371"></a><span class="lineno">  371</span>&#160;                <span class="comment">// This should not be reached.</span></div>
<div class="line"><a name="l00372"></a><span class="lineno">  372</span>&#160;                std::cout &lt;&lt; <span class="stringliteral">&quot;Error in Main switch-case!&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><a name="l00373"></a><span class="lineno">  373</span>&#160;                <span class="keywordflow">return</span> 1;</div>
<div class="line"><a name="l00374"></a><span class="lineno">  374</span>&#160;        } <span class="comment">// End switch-case.</span></div>
<div class="line"><a name="l00375"></a><span class="lineno">  375</span>&#160;    } <span class="comment">// End while.</span></div>
<div class="line"><a name="l00376"></a><span class="lineno">  376</span>&#160;</div>
<div class="line"><a name="l00377"></a><span class="lineno">  377</span>&#160;    <span class="comment">// Close output file for BOINC servers.</span></div>
<div class="line"><a name="l00378"></a><span class="lineno">  378</span>&#160;    outputFile.close();</div>
<div class="line"><a name="l00379"></a><span class="lineno">  379</span>&#160;</div>
<div class="line"><a name="l00380"></a><span class="lineno">  380</span>&#160;    <span class="comment">// Now print or record additional statistics here if desired.</span></div>
<div class="line"><a name="l00381"></a><span class="lineno">  381</span>&#160;    outputFile.open(std::string(argv[1]) + <span class="stringliteral">&quot;-statistics.csv&quot;</span>);</div>
<div class="line"><a name="l00382"></a><span class="lineno">  382</span>&#160;</div>
<div class="line"><a name="l00383"></a><span class="lineno">  383</span>&#160;    outputFile &lt;&lt; <span class="stringliteral">&quot;Statistics&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><a name="l00384"></a><span class="lineno">  384</span>&#160;    outputFile &lt;&lt; <span class="stringliteral">&quot;----------&quot;</span> &lt;&lt; std::endl &lt;&lt; std::endl;</div>
<div class="line"><a name="l00385"></a><span class="lineno">  385</span>&#160;    </div>
<div class="line"><a name="l00386"></a><span class="lineno">  386</span>&#160;    <span class="comment">// Nodes.</span></div>
<div class="line"><a name="l00387"></a><span class="lineno">  387</span>&#160;    <span class="keywordflow">for</span> (<span class="keyword">auto</span> nodeMapIterator : nodeMap) {</div>
<div class="line"><a name="l00388"></a><span class="lineno">  388</span>&#160;        outputFile &lt;&lt; <span class="stringliteral">&quot;Node &quot;</span> &lt;&lt; nodeMapIterator.first &lt;&lt; std::endl;</div>
<div class="line"><a name="l00389"></a><span class="lineno">  389</span>&#160;        outputFile &lt;&lt; <span class="stringliteral">&quot;----------&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><a name="l00390"></a><span class="lineno">  390</span>&#160;        outputFile &lt;&lt; <span class="stringliteral">&quot;Received bytes:      &quot;</span> &lt;&lt; nodeMapIterator.second-&gt;getReceivedBytesCount() &lt;&lt; std::endl;</div>
<div class="line"><a name="l00391"></a><span class="lineno">  391</span>&#160;        outputFile &lt;&lt; <span class="stringliteral">&quot;Received PDUs:       &quot;</span> &lt;&lt; nodeMapIterator.second-&gt;getReceivedPdusOrTokensCount() &lt;&lt; std::endl;</div>
<div class="line"><a name="l00392"></a><span class="lineno">  392</span>&#160;        outputFile &lt;&lt; <span class="stringliteral">&quot;Forwarded PDUs:      &quot;</span> &lt;&lt; nodeMapIterator.second-&gt;getForwardedPdusOrTokensCount() &lt;&lt; std::endl;</div>
<div class="line"><a name="l00393"></a><span class="lineno">  393</span>&#160;        outputFile &lt;&lt; <span class="stringliteral">&quot;Forwarded bytes:     &quot;</span> &lt;&lt; nodeMapIterator.second-&gt;getForwardedBytesCount() &lt;&lt; std::endl;</div>
<div class="line"><a name="l00394"></a><span class="lineno">  394</span>&#160;        outputFile &lt;&lt; <span class="stringliteral">&quot;Dropped PDUs:        &quot;</span> &lt;&lt; nodeMapIterator.second-&gt;getDroppedPdusOrTokensCount() &lt;&lt; std::endl;</div>
<div class="line"><a name="l00395"></a><span class="lineno">  395</span>&#160;        outputFile &lt;&lt; <span class="stringliteral">&quot;One-way delay:       &quot;</span> &lt;&lt; std::setprecision(10) &lt;&lt; nodeMapIterator.second-&gt;getLastPduOrTokenDelay() &lt;&lt; std::endl;</div>
<div class="line"><a name="l00396"></a><span class="lineno">  396</span>&#160;        outputFile &lt;&lt; <span class="stringliteral">&quot;Mean one-way delay:  &quot;</span> &lt;&lt; std::setprecision(10) &lt;&lt; nodeMapIterator.second-&gt;getMeanPduOrTokenDelay() &lt;&lt; std::endl;</div>
<div class="line"><a name="l00397"></a><span class="lineno">  397</span>&#160;        outputFile &lt;&lt; <span class="stringliteral">&quot;One-way jitter:      &quot;</span> &lt;&lt; std::setprecision(10) &lt;&lt; nodeMapIterator.second-&gt;getLastPduOrTokenJitter() &lt;&lt; std::endl;</div>
<div class="line"><a name="l00398"></a><span class="lineno">  398</span>&#160;        outputFile &lt;&lt; <span class="stringliteral">&quot;Mean one-way jitter: &quot;</span> &lt;&lt; std::setprecision(10) &lt;&lt; nodeMapIterator.second-&gt;getMeanPduOrTokenJitter() &lt;&lt; std::endl;</div>
<div class="line"><a name="l00399"></a><span class="lineno">  399</span>&#160;        outputFile &lt;&lt; std::endl &lt;&lt; std::endl;</div>
<div class="line"><a name="l00400"></a><span class="lineno">  400</span>&#160;    }</div>
<div class="line"><a name="l00401"></a><span class="lineno">  401</span>&#160;</div>
<div class="line"><a name="l00402"></a><span class="lineno">  402</span>&#160;    <span class="comment">// Links.</span></div>
<div class="line"><a name="l00403"></a><span class="lineno">  403</span>&#160;    <span class="keywordflow">for</span> (<span class="keyword">auto</span> linkMapIterator : linkMap) {</div>
<div class="line"><a name="l00404"></a><span class="lineno">  404</span>&#160;        outputFile &lt;&lt; <span class="stringliteral">&quot;Link &quot;</span> &lt;&lt; linkMapIterator.first &lt;&lt; <span class="stringliteral">&quot; &quot;</span> &lt;&lt; linkMapIterator.second-&gt;getName() &lt;&lt; std::endl;</div>
<div class="line"><a name="l00405"></a><span class="lineno">  405</span>&#160;        outputFile &lt;&lt; <span class="stringliteral">&quot;-----------------------&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><a name="l00406"></a><span class="lineno">  406</span>&#160;        outputFile &lt;&lt; <span class="stringliteral">&quot;Bandwidth (bps):           &quot;</span> &lt;&lt; linkMapIterator.second-&gt;getBandwidth() &lt;&lt; std::endl;</div>
<div class="line"><a name="l00407"></a><span class="lineno">  407</span>&#160;        outputFile &lt;&lt; <span class="stringliteral">&quot;Propagation delay (s):     &quot;</span> &lt;&lt; linkMapIterator.second-&gt;getPropagationDelay() &lt;&lt; std::endl;</div>
<div class="line"><a name="l00408"></a><span class="lineno">  408</span>&#160;        outputFile &lt;&lt; <span class="stringliteral">&quot;Dropped PDUs medium:       &quot;</span> &lt;&lt; linkMapIterator.second-&gt;getDroppedPdusCountMedium() &lt;&lt; std::endl;</div>
<div class="line"><a name="l00409"></a><span class="lineno">  409</span>&#160;        outputFile &lt;&lt; <span class="stringliteral">&quot;Dropped PDUs transmission: &quot;</span> &lt;&lt; linkMapIterator.second-&gt;getDroppedPdusCountTransmissionServer() &lt;&lt; std::endl;</div>
<div class="line"><a name="l00410"></a><span class="lineno">  410</span>&#160;        outputFile &lt;&lt; <span class="stringliteral">&quot;Dropped PDUs total:        &quot;</span> &lt;&lt; linkMapIterator.second-&gt;getDroppedPdusCountWholeLink() &lt;&lt; std::endl;</div>
<div class="line"><a name="l00411"></a><span class="lineno">  411</span>&#160;        outputFile &lt;&lt; <span class="stringliteral">&quot;Max recorded trans. queue: &quot;</span> &lt;&lt; linkMapIterator.second-&gt;getMaxRecordedTransmissionQueueSize() &lt;&lt; std::endl;</div>
<div class="line"><a name="l00412"></a><span class="lineno">  412</span>&#160;        outputFile &lt;&lt; std::endl &lt;&lt; std::endl;</div>
<div class="line"><a name="l00413"></a><span class="lineno">  413</span>&#160;    }</div>
<div class="line"><a name="l00414"></a><span class="lineno">  414</span>&#160;</div>
<div class="line"><a name="l00415"></a><span class="lineno">  415</span>&#160;</div>
<div class="line"><a name="l00416"></a><span class="lineno">  416</span>&#160;</div>
<div class="line"><a name="l00417"></a><span class="lineno">  417</span>&#160;    <span class="keywordflow">return</span> 0;</div>
<div class="line"><a name="l00418"></a><span class="lineno">  418</span>&#160;}</div>
<div class="ttc" id="_qcn_sim_c_c_grid_8cpp_html_a58c3c5ada720c7d45f1dfeaf181e4e0f"><div class="ttname"><a href="_qcn_sim_c_c_grid_8cpp.html#a58c3c5ada720c7d45f1dfeaf181e4e0f">REGION_A_SOURCE</a></div><div class="ttdeci">#define REGION_A_SOURCE</div><div class="ttdef"><b>Definition:</b> <a href="_qcn_sim_c_c_grid_8cpp_source.html#l00048">QcnSimCCGrid.cpp:48</a></div></div>
<div class="ttc" id="_qcn_sim_c_c_grid_8cpp_html_ace2cec71fb9a16df31aafa9b250e5648"><div class="ttname"><a href="_qcn_sim_c_c_grid_8cpp.html#ace2cec71fb9a16df31aafa9b250e5648">REGION_D_SOURCE</a></div><div class="ttdeci">#define REGION_D_SOURCE</div><div class="ttdef"><b>Definition:</b> <a href="_qcn_sim_c_c_grid_8cpp_source.html#l00051">QcnSimCCGrid.cpp:51</a></div></div>
<div class="ttc" id="class_seismic_event_data_html_a3cfac81095ec0d5b827fce06c443c006"><div class="ttname"><a href="class_seismic_event_data.html#a3cfac81095ec0d5b827fce06c443c006">SeismicEventData::qcnExplorerSensorId</a></div><div class="ttdeci">unsigned int qcnExplorerSensorId</div><div class="ttdoc">Unique sensor ID. </div><div class="ttdef"><b>Definition:</b> <a href="_seismic_event_data_8h_source.html#l00035">SeismicEventData.h:35</a></div></div>
<div class="ttc" id="class_protocol_data_unit_html"><div class="ttname"><a href="class_protocol_data_unit.html">ProtocolDataUnit</a></div><div class="ttdoc">Protocol Data Unit class. </div><div class="ttdef"><b>Definition:</b> <a href="_protocol_data_unit_8h_source.html#l00033">ProtocolDataUnit.h:33</a></div></div>
<div class="ttc" id="_qcn_sim_c_c_grid_8cpp_html_af03badce48baec1f9a831cfff15eb8bf"><div class="ttname"><a href="_qcn_sim_c_c_grid_8cpp.html#af03badce48baec1f9a831cfff15eb8bf">REGION_D_DESTINATION</a></div><div class="ttdeci">#define REGION_D_DESTINATION</div><div class="ttdef"><b>Definition:</b> <a href="_qcn_sim_c_c_grid_8cpp_source.html#l00056">QcnSimCCGrid.cpp:56</a></div></div>
<div class="ttc" id="class_scheduler_html"><div class="ttname"><a href="class_scheduler.html">Scheduler</a></div><div class="ttdoc">Scheduler class. </div><div class="ttdef"><b>Definition:</b> <a href="_scheduler_8h_source.html#l00058">Scheduler.h:58</a></div></div>
<div class="ttc" id="class_event_html"><div class="ttname"><a href="class_event.html">Event</a></div><div class="ttdoc">Event class. </div><div class="ttdef"><b>Definition:</b> <a href="_event_8h_source.html#l00035">Event.h:35</a></div></div>
<div class="ttc" id="class_node_html"><div class="ttname"><a href="class_node.html">Node</a></div><div class="ttdoc">Node class. </div><div class="ttdef"><b>Definition:</b> <a href="_node_8h_source.html#l00051">Node.h:51</a></div></div>
<div class="ttc" id="_event_type_8h_html_a2628ea8d12e8b2563c32f05dc7fff6faa9b31ea954f59af0f85d1ac9b65607772"><div class="ttname"><a href="_event_type_8h.html#a2628ea8d12e8b2563c32f05dc7fff6faa9b31ea954f59af0f85d1ac9b65607772">EventType::PDUTOKEN_ARRIVAL_AT_NODE</a></div><div class="ttdoc">A token or PDU arrives at a node. </div></div>
<div class="ttc" id="_qcn_sim_c_c_grid_8cpp_html_aacd5aeeefd3d2cdd0a2735dbf01fe1c3"><div class="ttname"><a href="_qcn_sim_c_c_grid_8cpp.html#aacd5aeeefd3d2cdd0a2735dbf01fe1c3">REGION_C_ID</a></div><div class="ttdeci">#define REGION_C_ID</div><div class="ttdef"><b>Definition:</b> <a href="_qcn_sim_c_c_grid_8cpp_source.html#l00045">QcnSimCCGrid.cpp:45</a></div></div>
<div class="ttc" id="_event_type_8h_html_a2628ea8d12e8b2563c32f05dc7fff6faaaef0e420b0327dd399b8206026228e6f"><div class="ttname"><a href="_event_type_8h.html#a2628ea8d12e8b2563c32f05dc7fff6faaaef0e420b0327dd399b8206026228e6f">EventType::SEISMIC_EVENT_DETECTION</a></div><div class="ttdoc">A seismic event reaches a QCN sensor and is detected by it. </div></div>
<div class="ttc" id="class_qcn_sensor_traffic_generator_html"><div class="ttname"><a href="class_qcn_sensor_traffic_generator.html">QcnSensorTrafficGenerator</a></div><div class="ttdoc">QCN Sensor Traffic Generator. </div><div class="ttdef"><b>Definition:</b> <a href="_qcn_sensor_traffic_generator_8h_source.html#l00035">QcnSensorTrafficGenerator.h:35</a></div></div>
<div class="ttc" id="_qcn_sim_c_c_grid_8cpp_html_a9749cc2e7e187e1f302d0158151b293d"><div class="ttname"><a href="_qcn_sim_c_c_grid_8cpp.html#a9749cc2e7e187e1f302d0158151b293d">REGION_A_DESTINATION</a></div><div class="ttdeci">#define REGION_A_DESTINATION</div><div class="ttdef"><b>Definition:</b> <a href="_qcn_sim_c_c_grid_8cpp_source.html#l00053">QcnSimCCGrid.cpp:53</a></div></div>
<div class="ttc" id="_qcn_sim_c_c_grid_8cpp_html_a14bd15123cf3bb9a64bf52c1aa988549"><div class="ttname"><a href="_qcn_sim_c_c_grid_8cpp.html#a14bd15123cf3bb9a64bf52c1aa988549">REGION_FAKE_ID</a></div><div class="ttdeci">#define REGION_FAKE_ID</div><div class="ttdef"><b>Definition:</b> <a href="_qcn_sim_c_c_grid_8cpp_source.html#l00047">QcnSimCCGrid.cpp:47</a></div></div>
<div class="ttc" id="_event_type_8h_html_a2628ea8d12e8b2563c32f05dc7fff6faa9bc56863b9fa691d4c06f5ff30f02420"><div class="ttname"><a href="_event_type_8h.html#a2628ea8d12e8b2563c32f05dc7fff6faa9bc56863b9fa691d4c06f5ff30f02420">EventType::SET_LINK_DOWN</a></div><div class="ttdoc">Sets link down. </div></div>
<div class="ttc" id="_qcn_sim_c_c_grid_8cpp_html_a240f0b8cc47ce12ef3257c8addcc1796"><div class="ttname"><a href="_qcn_sim_c_c_grid_8cpp.html#a240f0b8cc47ce12ef3257c8addcc1796">BANDWIDTH_REGION_FAKE</a></div><div class="ttdeci">#define BANDWIDTH_REGION_FAKE</div><div class="ttdef"><b>Definition:</b> <a href="_qcn_sim_c_c_grid_8cpp_source.html#l00041">QcnSimCCGrid.cpp:41</a></div></div>
<div class="ttc" id="class_seismic_event_data_html"><div class="ttname"><a href="class_seismic_event_data.html">SeismicEventData</a></div><div class="ttdoc">Seismic Event Data class. </div><div class="ttdef"><b>Definition:</b> <a href="_seismic_event_data_8h_source.html#l00033">SeismicEventData.h:33</a></div></div>
<div class="ttc" id="_event_type_8h_html_a2628ea8d12e8b2563c32f05dc7fff6faaa6f2ce7722792bb5a4c114a8d4f3b7f4"><div class="ttname"><a href="_event_type_8h.html#a2628ea8d12e8b2563c32f05dc7fff6faaa6f2ce7722792bb5a4c114a8d4f3b7f4">EventType::REROUTE_QCN_TRAFFIC</a></div><div class="ttdoc">Reroutes traffic from QCN sensors. </div></div>
<div class="ttc" id="_qcn_sim_c_c_grid_8cpp_html_a7847900052c44e0128d7aed8e33fd57d"><div class="ttname"><a href="_qcn_sim_c_c_grid_8cpp.html#a7847900052c44e0128d7aed8e33fd57d">PROPAGATION_REGION_A</a></div><div class="ttdeci">#define PROPAGATION_REGION_A</div><div class="ttdef"><b>Definition:</b> <a href="_qcn_sim_c_c_grid_8cpp_source.html#l00034">QcnSimCCGrid.cpp:34</a></div></div>
<div class="ttc" id="_qcn_sim_c_c_grid_8cpp_html_ac3df39d3fa181f7564443145014c76d2"><div class="ttname"><a href="_qcn_sim_c_c_grid_8cpp.html#ac3df39d3fa181f7564443145014c76d2">REGION_FAKE_SOURCE</a></div><div class="ttdeci">#define REGION_FAKE_SOURCE</div><div class="ttdef"><b>Definition:</b> <a href="_qcn_sim_c_c_grid_8cpp_source.html#l00052">QcnSimCCGrid.cpp:52</a></div></div>
<div class="ttc" id="class_entity_html"><div class="ttname"><a href="class_entity.html">Entity</a></div><div class="ttdoc">Entity class. </div><div class="ttdef"><b>Definition:</b> <a href="_entity_8h_source.html#l00029">Entity.h:29</a></div></div>
<div class="ttc" id="class_event_html_a491887ba31c3f39b85930214133236fd"><div class="ttname"><a href="class_event.html#a491887ba31c3f39b85930214133236fd">Event::eventType</a></div><div class="ttdeci">EventType eventType</div><div class="ttdoc">Type of the event. </div><div class="ttdef"><b>Definition:</b> <a href="_event_8h_source.html#l00038">Event.h:38</a></div></div>
<div class="ttc" id="_node_return_type_8h_html_a653f4b3757de7a3613c60211493c60c1ab9804cb278b1f322f56a216720a67eec"><div class="ttname"><a href="_node_return_type_8h.html#a653f4b3757de7a3613c60211493c60c1ab9804cb278b1f322f56a216720a67eec">NodeReturnType::FINAL_DESTINATION</a></div><div class="ttdoc">This node is the final destination. Stats updated, nothing else to do in node. </div></div>
<div class="ttc" id="_event_type_8h_html_a2628ea8d12e8b2563c32f05dc7fff6faaa8dbff7900a4d5c983629de5a6f58d78"><div class="ttname"><a href="_event_type_8h.html#a2628ea8d12e8b2563c32f05dc7fff6faaa8dbff7900a4d5c983629de5a6f58d78">EventType::TRAFFIC_GENERATOR_ARRIVAL</a></div><div class="ttdoc">Arrival of instance of traffic generator. </div></div>
<div class="ttc" id="_qcn_sim_c_c_grid_8cpp_html_adee06583f1b8b5964a4793f98f3f4bc7"><div class="ttname"><a href="_qcn_sim_c_c_grid_8cpp.html#adee06583f1b8b5964a4793f98f3f4bc7">REGION_D_ID</a></div><div class="ttdeci">#define REGION_D_ID</div><div class="ttdef"><b>Definition:</b> <a href="_qcn_sim_c_c_grid_8cpp_source.html#l00046">QcnSimCCGrid.cpp:46</a></div></div>
<div class="ttc" id="class_event_html_a97fb29e53119ce8179674bf46f23d24e"><div class="ttname"><a href="class_event.html#a97fb29e53119ce8179674bf46f23d24e">Event::entity</a></div><div class="ttdeci">std::shared_ptr&lt; const Entity &gt; entity</div><div class="ttdoc">Simulator entity object associated with event. </div><div class="ttdef"><b>Definition:</b> <a href="_event_8h_source.html#l00039">Event.h:39</a></div></div>
<div class="ttc" id="_qcn_sim_c_c_grid_8cpp_html_a21723b939da0ed1a32b68488677cef98"><div class="ttname"><a href="_qcn_sim_c_c_grid_8cpp.html#a21723b939da0ed1a32b68488677cef98">REROUTE_TRAFFIC</a></div><div class="ttdeci">#define REROUTE_TRAFFIC</div><div class="ttdef"><b>Definition:</b> <a href="_qcn_sim_c_c_grid_8cpp_source.html#l00063">QcnSimCCGrid.cpp:63</a></div></div>
<div class="ttc" id="_qcn_sim_c_c_grid_8cpp_html_a44d8a25b9f10356063cd072a556efa22"><div class="ttname"><a href="_qcn_sim_c_c_grid_8cpp.html#a44d8a25b9f10356063cd072a556efa22">REROUTE_TRAFFIC_TIME</a></div><div class="ttdeci">#define REROUTE_TRAFFIC_TIME</div><div class="ttdef"><b>Definition:</b> <a href="_qcn_sim_c_c_grid_8cpp_source.html#l00062">QcnSimCCGrid.cpp:62</a></div></div>
<div class="ttc" id="_event_type_8h_html_a2628ea8d12e8b2563c32f05dc7fff6faa3767fd6cb828899aafbe567387a1c823"><div class="ttname"><a href="_event_type_8h.html#a2628ea8d12e8b2563c32f05dc7fff6faa3767fd6cb828899aafbe567387a1c823">EventType::END_PROPAGATION_AT_LINK</a></div><div class="ttdoc">Ends propagation of a PDU in a link. Schedule next event (typically ARRIVAL_AT_NODE). </div></div>
<div class="ttc" id="_qcn_sim_c_c_grid_8cpp_html_a121218679b2ffe08b52abaf30eb20ab0"><div class="ttname"><a href="_qcn_sim_c_c_grid_8cpp.html#a121218679b2ffe08b52abaf30eb20ab0">LINK_FAILURE</a></div><div class="ttdeci">#define LINK_FAILURE</div><div class="ttdef"><b>Definition:</b> <a href="_qcn_sim_c_c_grid_8cpp_source.html#l00061">QcnSimCCGrid.cpp:61</a></div></div>
<div class="ttc" id="_qcn_sim_c_c_grid_8cpp_html_a94fa0bdb40ee4da20e3d8d227276a1c0"><div class="ttname"><a href="_qcn_sim_c_c_grid_8cpp.html#a94fa0bdb40ee4da20e3d8d227276a1c0">REGION_C_SOURCE</a></div><div class="ttdeci">#define REGION_C_SOURCE</div><div class="ttdef"><b>Definition:</b> <a href="_qcn_sim_c_c_grid_8cpp_source.html#l00050">QcnSimCCGrid.cpp:50</a></div></div>
<div class="ttc" id="_qcn_sim_c_c_grid_8cpp_html_a4bdc13655ee7bf4cf0e66d16e22dc103"><div class="ttname"><a href="_qcn_sim_c_c_grid_8cpp.html#a4bdc13655ee7bf4cf0e66d16e22dc103">PDU_SIZE</a></div><div class="ttdeci">#define PDU_SIZE</div><div class="ttdef"><b>Definition:</b> <a href="_qcn_sim_c_c_grid_8cpp_source.html#l00032">QcnSimCCGrid.cpp:32</a></div></div>
<div class="ttc" id="_qcn_sim_c_c_grid_8cpp_html_ac4f0f4199bf2f7c707e8ac44ef80dc95"><div class="ttname"><a href="_qcn_sim_c_c_grid_8cpp.html#ac4f0f4199bf2f7c707e8ac44ef80dc95">REGION_C_DESTINATION</a></div><div class="ttdeci">#define REGION_C_DESTINATION</div><div class="ttdef"><b>Definition:</b> <a href="_qcn_sim_c_c_grid_8cpp_source.html#l00055">QcnSimCCGrid.cpp:55</a></div></div>
<div class="ttc" id="_event_type_8h_html_a2628ea8d12e8b2563c32f05dc7fff6faa7b83d89c39b12ab66465087a3118a3ac"><div class="ttname"><a href="_event_type_8h.html#a2628ea8d12e8b2563c32f05dc7fff6faa7b83d89c39b12ab66465087a3118a3ac">EventType::END_TRANSMISSION_PROPAGATE_PDU_AT_LINK</a></div><div class="ttdoc">Propagates a PDU through a link (typically a fixed-time delay). </div></div>
<div class="ttc" id="_qcn_sim_c_c_grid_8cpp_html_a8e4724f509582fd412b65aa79d7ebe1e"><div class="ttname"><a href="_qcn_sim_c_c_grid_8cpp.html#a8e4724f509582fd412b65aa79d7ebe1e">LINK_DOWN_TIME</a></div><div class="ttdeci">#define LINK_DOWN_TIME</div><div class="ttdef"><b>Definition:</b> <a href="_qcn_sim_c_c_grid_8cpp_source.html#l00060">QcnSimCCGrid.cpp:60</a></div></div>
<div class="ttc" id="class_simulator_globals_html"><div class="ttname"><a href="class_simulator_globals.html">SimulatorGlobals</a></div><div class="ttdoc">Simulator-scope variables and parameters. </div><div class="ttdef"><b>Definition:</b> <a href="_simulator_globals_8h_source.html#l00158">SimulatorGlobals.h:158</a></div></div>
<div class="ttc" id="_qcn_sim_c_c_grid_8cpp_html_a453b0cdfacfb82674c0846ffcbd42460"><div class="ttname"><a href="_qcn_sim_c_c_grid_8cpp.html#a453b0cdfacfb82674c0846ffcbd42460">REGION_B_SOURCE</a></div><div class="ttdeci">#define REGION_B_SOURCE</div><div class="ttdef"><b>Definition:</b> <a href="_qcn_sim_c_c_grid_8cpp_source.html#l00049">QcnSimCCGrid.cpp:49</a></div></div>
<div class="ttc" id="_qcn_sim_c_c_grid_8cpp_html_a0c175fc00c53b14b300e30a773b91b94"><div class="ttname"><a href="_qcn_sim_c_c_grid_8cpp.html#a0c175fc00c53b14b300e30a773b91b94">MAX_SIMULATION_TIME</a></div><div class="ttdeci">#define MAX_SIMULATION_TIME</div><div class="ttdef"><b>Definition:</b> <a href="_qcn_sim_c_c_grid_8cpp_source.html#l00059">QcnSimCCGrid.cpp:59</a></div></div>
<div class="ttc" id="_event_type_8h_html_a2628ea8d12e8b2563c32f05dc7fff6faa96955421ee351c21ef8b232bc9d8998d"><div class="ttname"><a href="_event_type_8h.html#a2628ea8d12e8b2563c32f05dc7fff6faa96955421ee351c21ef8b232bc9d8998d">EventType::END_SIMULATION</a></div><div class="ttdoc">End of simulation event. Should be the last event to occur in the simulation, and the Event Chain sho...</div></div>
<div class="ttc" id="_qcn_sim_c_c_grid_8cpp_html_a0bf380a4597f3e8e702b3f4fcb31a17e"><div class="ttname"><a href="_qcn_sim_c_c_grid_8cpp.html#a0bf380a4597f3e8e702b3f4fcb31a17e">REGION_A_ID</a></div><div class="ttdeci">#define REGION_A_ID</div><div class="ttdef"><b>Definition:</b> <a href="_qcn_sim_c_c_grid_8cpp_source.html#l00043">QcnSimCCGrid.cpp:43</a></div></div>
<div class="ttc" id="_qcn_sim_c_c_grid_8cpp_html_a25003fc4313519b1e49e07940e1a2f9c"><div class="ttname"><a href="_qcn_sim_c_c_grid_8cpp.html#a25003fc4313519b1e49e07940e1a2f9c">PROPAGATION_REGION_FAKE</a></div><div class="ttdeci">#define PROPAGATION_REGION_FAKE</div><div class="ttdef"><b>Definition:</b> <a href="_qcn_sim_c_c_grid_8cpp_source.html#l00042">QcnSimCCGrid.cpp:42</a></div></div>
<div class="ttc" id="_qcn_sim_c_c_grid_8cpp_html_ab0894b9662d0cf6a3b811e45bbe1db40"><div class="ttname"><a href="_qcn_sim_c_c_grid_8cpp.html#ab0894b9662d0cf6a3b811e45bbe1db40">BANDWIDTH_REGION_A</a></div><div class="ttdeci">#define BANDWIDTH_REGION_A</div><div class="ttdef"><b>Definition:</b> <a href="_qcn_sim_c_c_grid_8cpp_source.html#l00033">QcnSimCCGrid.cpp:33</a></div></div>
<div class="ttc" id="_qcn_sim_c_c_grid_8cpp_html_acdb16bb6018a7c85d3160c15e9d4089a"><div class="ttname"><a href="_qcn_sim_c_c_grid_8cpp.html#acdb16bb6018a7c85d3160c15e9d4089a">REGION_B_ID</a></div><div class="ttdeci">#define REGION_B_ID</div><div class="ttdef"><b>Definition:</b> <a href="_qcn_sim_c_c_grid_8cpp_source.html#l00044">QcnSimCCGrid.cpp:44</a></div></div>
<div class="ttc" id="_qcn_sim_c_c_grid_8cpp_html_a146501a7eea204bdae387e00e88031fb"><div class="ttname"><a href="_qcn_sim_c_c_grid_8cpp.html#a146501a7eea204bdae387e00e88031fb">findLinkByNodeB</a></div><div class="ttdeci">std::shared_ptr&lt; Link &gt; findLinkByNodeB(std::map&lt; unsigned int, std::shared_ptr&lt; Link &gt;&gt; linkMap, std::shared_ptr&lt; Node &gt; nodeB)</div><div class="ttdoc">Finds and returns a link pointer form a map of links, given the nodeB. </div><div class="ttdef"><b>Definition:</b> <a href="_qcn_sim_c_c_grid_8cpp_source.html#l00074">QcnSimCCGrid.cpp:74</a></div></div>
<div class="ttc" id="_qcn_sim_c_c_grid_8cpp_html_a07f75b830427f4fa3f743119b555dd41"><div class="ttname"><a href="_qcn_sim_c_c_grid_8cpp.html#a07f75b830427f4fa3f743119b555dd41">REGION_FAKE_DESTINATION</a></div><div class="ttdeci">#define REGION_FAKE_DESTINATION</div><div class="ttdef"><b>Definition:</b> <a href="_qcn_sim_c_c_grid_8cpp_source.html#l00057">QcnSimCCGrid.cpp:57</a></div></div>
<div class="ttc" id="_qcn_sim_c_c_grid_8cpp_html_a31c31bc14c0a859acd22b782f55e38a2"><div class="ttname"><a href="_qcn_sim_c_c_grid_8cpp.html#a31c31bc14c0a859acd22b782f55e38a2">PRINT_TRACE</a></div><div class="ttdeci">#define PRINT_TRACE</div><div class="ttdef"><b>Definition:</b> <a href="_qcn_sim_c_c_grid_8cpp_source.html#l00064">QcnSimCCGrid.cpp:64</a></div></div>
<div class="ttc" id="_event_type_8h_html_a2628ea8d12e8b2563c32f05dc7fff6faa2f5f57b148fe966a93f58ed00865a12b"><div class="ttname"><a href="_event_type_8h.html#a2628ea8d12e8b2563c32f05dc7fff6faa2f5f57b148fe966a93f58ed00865a12b">EventType::REQUEST_PDU_TRANSMISSION_AT_LINK</a></div><div class="ttdoc">Request that a link transmits a PDU. </div></div>
<div class="ttc" id="class_link_html"><div class="ttname"><a href="class_link.html">Link</a></div><div class="ttdoc">Link class. </div><div class="ttdef"><b>Definition:</b> <a href="_link_8h_source.html#l00069">Link.h:69</a></div></div>
<div class="ttc" id="_qcn_sim_c_c_grid_8cpp_html_a34ba3a12764116b2aaa23d3165305295"><div class="ttname"><a href="_qcn_sim_c_c_grid_8cpp.html#a34ba3a12764116b2aaa23d3165305295">REGION_B_DESTINATION</a></div><div class="ttdeci">#define REGION_B_DESTINATION</div><div class="ttdef"><b>Definition:</b> <a href="_qcn_sim_c_c_grid_8cpp_source.html#l00054">QcnSimCCGrid.cpp:54</a></div></div>
</div><!-- fragment -->
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Mon Jan 6 2014 12:30:39 for QCNSim by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.5
</small></address>
</body>
</html>
